var testData = new CompilationTestData(); testData.SyntaxTrees.Add(SyntaxFactory.ParseSyntaxTree("class Test {}"));
var testData = new CompilationTestData(); testData.References.Add(MetadataReference.CreateFromFile("path/to/assembly.dll"));
var testData = new CompilationTestData(); testData.CompilationOptions = testData.CompilationOptions.WithPreprocessorSymbols("DEBUG");In these examples, CompilationTestData is used to create and configure a test case for compilation. The resulting test case can be used to validate the behavior of the C# compiler or other tools that depend on it.