public static void Main(string[] args) { string instruction = "Input path"; try { TicketFactory tickets = new TicketFactory(); switch (GetAlghorithm(args)) { case Alghorithm.Moscow: MoscowTicketAlghorithm moscowAlghorithm = new MoscowTicketAlghorithm(tickets); Console.WriteLine("Moscow Alghorithm:{0}", moscowAlghorithm.CountLuckyTickets()); break; case Alghorithm.Piter: PiterTicketAlghorithm piterAlghorithm = new PiterTicketAlghorithm(tickets); Console.WriteLine("Piter Alghorithm:{0}", piterAlghorithm.CountLuckyTickets()); break; case Alghorithm.None: Console.WriteLine("Not complete"); break; } } catch (FileNotFoundException e) { Console.WriteLine(instruction); } catch (ArgumentOutOfRangeException e) { Console.WriteLine(instruction); } }
protected LuckyTicketInspectorAlghorithm(TicketFactory tickets) { _tickets = tickets; }