This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using OpenQA.Selenium; | |
public static class HourSelector | |
{ | |
public static (int, int)? SelectHour(IWebElement element, bool isSaturday) | |
{ | |
const string satHour = "08:00 - 09:00"; // Weekends saturday time | |
const string eachHours = "18:30 - 19:30"; // Weekdays time | |
for (int repeater = 0; repeater <= 13; repeater++) // 13 repeater count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
PhoneFactory pf1 = new PhoneFactory(); | |
pf1.MakePhone(new Iphone()); | |
PhoneFactory pf2 = new PhoneFactory(); | |
pf2.MakePhone(new Samsung()); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PhoneFactory | |
{ | |
public void MakePhone(Phone phone) | |
{ | |
phone.Make(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class Phone | |
{ | |
public abstract void Make(); | |
} | |
public class Iphone : Phone | |
{ | |
public override void Make() | |
{ | |
Console.WriteLine("Iphone Created\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
PhoneFactory pf1 = new PhoneFactory(); | |
pf1.MakePhone(new Iphone()); | |
PhoneFactory pf2 = new PhoneFactory(); | |
pf2.MakePhone(new Samsung()); | |
Console.ReadLine(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PhoneFactory | |
{ | |
public void MakePhone(Phone phone) | |
{ | |
switch (phone.Type) | |
{ | |
case PhoneType.Iphone: | |
MakeIphone((Iphone)phone); | |
break; | |
case PhoneType.Samsung: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Phone | |
{ | |
public PhoneType Type { get; set; } | |
} | |
public enum PhoneType | |
{ | |
Iphone, | |
Samsung | |
} | |
public class Iphone : Phone |