Ejemplo n.º 1
0
        public void TestCompilerOutput(string category, string testName)
        {
            ITestContext     testContext     = TestContextFactory.GetContext(category, testName);
            ICompilationUnit compilationUnit = CompilationUnitFactory.CreateCompilationUnitBuilder()
                                               .WithTestContext(testContext)
                                               .Build();

            Assert.True(compilationUnit.Compile(out ICompilationUnitResult result), result?.WriteErrors());

            string expectedOutput = testContext.GetExpectedOutput();

            Assert.Equal(expectedOutput, result.Output, compilerCompliationFixture.FileComparer);

            if (testContext.GetExpectedMetadata() is string expectedMetadata)
            {
                Assert.Equal(expectedMetadata, result.Metadata, compilerCompliationFixture.FileComparer);
            }
        }