コード例 #1
0
 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");
 }
コード例 #2
0
 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());
         }
     }
 }
コード例 #3
0
 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());
         }
     }
 }