Example #1
0
        public void RunTestCase(string testFile)
        {
            try
            {
                string        testFilePath         = this.ResolvePath(testFile);
                CompileUnit[] array                = CSharpAssertModule.Convert(new FileInput(testFilePath));
                CompileUnit   resultingCSharpNode  = array[0];
                CompileUnit   resultingBooNode     = array[1];
                string[]      expectedOutput       = this.GetExpectedOutput(testFilePath);
                string        expectedCSharpOutput = expectedOutput[0];
                string        expectedBooOutput    = expectedOutput[1];
                string        inputJSCode          = expectedOutput[2];
                Debug.WriteLine("JavaScript:\n" + inputJSCode);

                var output = new StringWriter();
                resultingCSharpNode.Accept(new CSharpPrinter(output));
                Debug.WriteLine("Generated C#:\n" + output.ToString().TrimEnd());
                Debug.WriteLine("Generated Boo:\n" + resultingBooNode.ToCodeString());

                CSharpAssertModule.AssertCSharpCode(expectedCSharpOutput, resultingCSharpNode);
                StringsModule.AssertAreEqualIgnoringNewLineDifferences(expectedBooOutput, resultingBooNode.ToCodeString());
            }
            catch (CompilationErrorsException x)
            {
                Assert.Fail(x.Errors.ToString(true));
            }
        }
Example #2
0
 public static void printBooCodeFor(CompileUnit cu)
 {
     Console.WriteLine(cu.ToCodeString());
 }