public void MoscowMethod_ExceptionThrow(int leftBorder, int rightBorder) { //Arrange //Act MoscowMethod moscowMethod = MoscowMethod.MoscovMethodInitialize(leftBorder, rightBorder); //Assert }
public void MoscowMethodCalculatingCaunt(int leftBorder, int rightBorder, int expectedCount) { //Arrange int count = 0; //Act MoscowMethod moscowMethod = MoscowMethod.MoscovMethodInitialize(leftBorder, rightBorder); foreach (Ticket t in moscowMethod.GetTickets()) { count++; } //Assert Assert.AreEqual(count, expectedCount); }
public static void CallMenu() { const int RIGHT_COUNT_OF_ARGS = 2; string[] args = Environment.GetCommandLineArgs(); Instruction(); try { switch (args.Length) { case RIGHT_COUNT_OF_ARGS: { Console.WriteLine("Please input left border:"); int.TryParse(Console.ReadLine(), out int leftborder); Console.WriteLine("Please input right border:"); int.TryParse(Console.ReadLine(), out int rightborder); HappyTickets h; if (ReadFile(args[1]) == "Piter") { h = PiterMethod.PiterMethodInitialize(leftborder, rightborder); Console.WriteLine(h.CountOfHappyTicket); } if (ReadFile(args[1]) == "Moskow") { h = MoscowMethod.MoscovMethodInitialize(leftborder, rightborder); Console.WriteLine(h.CountOfHappyTicket); } Console.ReadLine(); break; } default: { Instruction(); break; } } } catch (Exception) { Instruction(); } }