Skip to content

Instantly share code, notes, and snippets.

View hsynkrcf's full-sized avatar
🎯
Focusing

Hüseyin Karacif hsynkrcf

🎯
Focusing
View GitHub Profile
@hsynkrcf
hsynkrcf / HourSelector.cs
Created February 12, 2024 14:02
Automated Appointment Maker to Spor İstanbul by Selenium
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
@hsynkrcf
hsynkrcf / Program.cs
Created November 10, 2022 00:40
YES OCP
class Program
{
static void Main(string[] args)
{
PhoneFactory pf1 = new PhoneFactory();
pf1.MakePhone(new Iphone());
PhoneFactory pf2 = new PhoneFactory();
pf2.MakePhone(new Samsung());
@hsynkrcf
hsynkrcf / PhoneFactory.cs
Created November 10, 2022 00:34
YES OCP
public class PhoneFactory
{
public void MakePhone(Phone phone)
{
phone.Make();
}
}
@hsynkrcf
hsynkrcf / Phone.cs
Created November 10, 2022 00:27
YES OCP
public abstract class Phone
{
public abstract void Make();
}
public class Iphone : Phone
{
public override void Make()
{
Console.WriteLine("Iphone Created\n");
@hsynkrcf
hsynkrcf / Program.cs
Last active November 9, 2022 22:56
OCP
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();
}
public class PhoneFactory
{
public void MakePhone(Phone phone)
{
switch (phone.Type)
{
case PhoneType.Iphone:
MakeIphone((Iphone)phone);
break;
case PhoneType.Samsung:
@hsynkrcf
hsynkrcf / Phone.cs
Created November 9, 2022 22:22
OCP
public class Phone
{
public PhoneType Type { get; set; }
}
public enum PhoneType
{
Iphone,
Samsung
}
public class Iphone : Phone