public void WriteOutputFile() { var inputFileId = "input_1.txt"; var printer = new OutputPrinter(); var inputFileList = new List<string> { "test", "input", "text" }; printer.printOutputList(inputFileList, inputFileId); var reader = new StreamReader(@"output_1.txt"); var outputText = reader.ReadToEnd(); reader.Close(); Assert.AreEqual("test\r\ninput\r\ntext\r\n", outputText); File.Delete(@"output_1.txt"); }
static void Main(string[] args) { // iterate through arguments for (int i = 0; i < args.Length; i++) { if (File.Exists(args[i])) // Checks to see if the file really exists { InputReader reader = new InputReader(); TextParser parser = new TextParser(); OutputPrinter printer = new OutputPrinter(); printer.printOutputList(parser.ParseSortedList(reader.readFile(args[i])), args[i].ToString()); } } }