public static void Main() { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; var center = new ShoppingCenter2(); int commands = int.Parse(Console.ReadLine()); for (int i = 1; i <= commands; i++) { string command = Console.ReadLine(); string commandResult = center.ProcessCommand(command); Console.WriteLine(commandResult); } }
private void ExecuteTest(string inputFileName, string outputFileName) { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; var shoppingCenter = new ShoppingCenter2(); var inputCommands = File.ReadAllLines(@"..\..\..\Judge-Tests\" + inputFileName); var output = new StringBuilder(); int commandsCount = int.Parse(inputCommands[0]); for (int i = 1; i <= commandsCount; i++) { string command = inputCommands[i]; if (!string.IsNullOrEmpty(command)) { var commandOutput = shoppingCenter.ProcessCommand(command); output.AppendLine(commandOutput); } } var expectedOutput = File.ReadAllText(@"..\..\..\Judge-Tests\" + outputFileName); var actualOutput = output.ToString(); Assert.AreEqual(expectedOutput, actualOutput); }