public static void Main() { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; var center = new ShoppingCenterFast(); 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) { var shoppingCenter = new ShoppingCenterFast(); 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); }
private void ExecuteTest(string inputFileName, string outputFileName) { var shoppingCenter = new ShoppingCenterFast(); 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); }