Boo.Lang.Parser.Tests.AbstractParserTestFixture.RunParserTestCase C# (CSharp) Method

RunParserTestCase() protected method

protected RunParserTestCase ( string testfile ) : void
testfile string
return void
        protected void RunParserTestCase(string testfile)
        {
            _compiler.Parameters.Input.Add(GetCompilerInput(testfile));
            Boo.Lang.Compiler.CompilerContext context = _compiler.Run();
            if (context.Errors.Count > 0)
            {
                Assert.Fail(context.Errors.ToString(true));
            }

            Assert.AreEqual(1, context.CompileUnit.Modules.Count, "expected a module as output");

            string expected = GetDocumentation(context.CompileUnit.Modules[0]);

            string output = _compiler.Parameters.OutputWriter.ToString();
            Assert.AreEqual(expected.Trim(), output.ToString().Trim().Replace("\r\n", "\n"), testfile);
        }