Exemplo n.º 1
0
 public static bool FileTest(string TestInputPath, string ExpectedResultsPath, Action <string[]> method)
 {
     using (TempFile t = new TempFile("output.txt", null))
     {
         TestCaseLoader.SetUp(TestInputPath, t.Filename);
         method(null);
         TestCaseLoader.TearDown();
         return(TestCaseLoader.CompareOutput(ExpectedResultsPath, "output.txt"));
     }
 }
Exemplo n.º 2
0
 public static bool TempFileTest(string input, string expectedOutput, Action <string[]> method)
 {
     using (TempFile inputFile = new TempFile("input.txt", input))
         using (TempFile outputFile = new TempFile("output.txt", ""))
             using (TempFile expectedFile = new TempFile("expectedOutput.txt", expectedOutput))
             {
                 TestCaseLoader.SetUp(inputFile.Filename, outputFile.Filename);
                 method(null);
                 TestCaseLoader.TearDown();
                 return(TestCaseLoader.CompareOutput(expectedFile.Filename, outputFile.Filename));
             }
 }