protected void RunTest(Action <Compilation> compilationInitializer, string baselineFile, bool avoidStandardReferences)
        {
            Compilation compilation = CreateCompilation(avoidStandardReferences);

            compilationInitializer(compilation);

            bool result = compilation.Execute();

            Assert.IsTrue(result, "Compilation failed.");

            string baselinePath = GetTestFilePath(baselineFile);
            string baseline     = File.ReadAllText(baselinePath, new UTF8Encoding(false));
            string output       = compilation.Output.GeneratedOutput;

            Assert.AreEqual(baseline, output, "Unexpected differences between baseline and result.");
        }
        protected void RunTest(Action <Compilation> compilationInitializer, string baselineFile, bool avoidStandardReferences)
        {
            Compilation compilation = CreateCompilation(avoidStandardReferences);

            compilationInitializer(compilation);

            bool result = compilation.Execute();

            Assert.IsTrue(result, "Compilation failed.");

            string baselinePath = GetTestFilePath(baselineFile);
            string baseline     = File.ReadAllText(baselinePath);
            string output       = compilation.Output.GeneratedOutput;

            bool validResults = ValidateResults(output, baselineFile);

            if (validResults == false)
            {
                string outputPath = Path.Combine(_context.TestRunDirectory, "..", this.GetType().Name + "." + _context.TestName + ".txt");
                File.WriteAllText(outputPath, output);
            }

            Assert.IsTrue(validResults, "Unexpected differences between baseline and result.");
        }