Compilation\CompilationAPITests.cs (21)
559var t1 = Parse(@"
567var t2 = Parse(@"
575var t3 = Parse(@"
582var t4 = Parse(@"
1690var compilation = CSharpCompilation.Create(assemblyName: null, options: TestOptions.ReleaseModule, syntaxTrees: new[] { Parse(source) }, references: new[] { MscorlibRef });
1698compilation = CSharpCompilation.Create(assemblyName: null, options: TestOptions.ReleaseDll, syntaxTrees: new[] { Parse(source) }, references: new[] { MscorlibRef });
1706compilation = CSharpCompilation.Create(assemblyName: "ModuleAssemblyName", options: TestOptions.ReleaseModule, syntaxTrees: new[] { Parse(source) }, references: new[] { MscorlibRef });
1742syntaxTree: Parse("true", options: TestOptions.Script)
1750syntaxTree: Parse("false", options: TestOptions.Script))
1812syntaxTree: Parse(source, options: TestOptions.Script));
1836syntaxTree: Parse(source, options: TestOptions.Script));
2066var ta = Parse("class C { }", options: TestOptions.Regular10);
2068var tb = Parse(@"
2071var tc = Parse(@"
2075var tr = Parse(@"
2079var ts = Parse(@"
2208var c3 = c2.AddSyntaxTrees(Parse("public class Main2 { public static int a; }"));
2256new[] { Parse("") },
2277new[] { Parse("") },
2313new[] { Parse(src1) },
2338new[] { Parse(src2) },
Compilation\ReferenceManagerTests.cs (11)
740var tree = Parse(source);
864t1 = Parse($"#r \"{p2}\"", options: TestOptions.Script),
865t2 = Parse($"#r \"{p3}\"", options: TestOptions.Script),
866t3 = Parse("#r \"Lib\"", options: TestOptions.Script),
1277Parse("#r \"1\"", options: TestOptions.Script),
1278Parse("#r \"2.dll\"", options: TestOptions.Script),
1323Parse("#r \"throw\"", options: TestOptions.Script),
1335syntaxTrees: new[] { Parse("class C {}") },
1340var c2 = c1.AddSyntaxTrees(Parse("class D { }"));
1349var t1 = Parse(@"
1355var t2 = Parse(@"
Compilation\UsedAssembliesTests.cs (5)
164yield return (comp.ReplaceSyntaxTree(tree, CSharpTestBase.Parse(builder.ToString(), tree.FilePath, (CSharpParseOptions)tree.Options)), before, after);
192yield return (comp.ReplaceSyntaxTree(tree, CSharpTestBase.Parse(builder.ToString(), tree.FilePath, parseOptions)), before, after);
203yield return (comp.ReplaceSyntaxTree(tree, CSharpTestBase.Parse(builder.ToString(), tree.FilePath, parseOptions)).
204AddSyntaxTrees(CSharpTestBase.Parse(globalUsings, "", parseOptions)), before, after);
2339AssertUsedAssemblyReferences(CreateCompilation(Parse(source, options: TestOptions.Script), references: new[] { reference }, options: TestOptions.DebugDll.WithUsings(@using)),
DocumentationComments\DocumentationCommentCompilerTests.cs (11)
2354var revisedSource = new DocumentationCommentAdder().Visit(Parse(source).GetCompilationUnitRoot()).ToFullString();
2538var revisedSource = new DocumentationCommentAdder().Visit(Parse(source).GetCompilationUnitRoot()).ToFullString();
2907var revisedSource = new DocumentationCommentAdder().Visit(Parse(source).GetCompilationUnitRoot()).ToFullString();
3162var tree1 = Parse(source1, options: TestOptions.RegularWithDocumentationComments);
3163var tree2 = Parse(source2, options: TestOptions.RegularWithDocumentationComments);
3658var tree = Parse(source, options: TestOptions.RegularWithDocumentationComments);
4520var tree = Parse(source, options: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse));
5758var tree = Parse(source, options: TestOptions.RegularWithDocumentationComments);
6010SyntaxTree tree = Parse(source, options: TestOptions.RegularWithDocumentationComments);
7115var tree = Parse(source, options: TestOptions.RegularWithDocumentationComments);
7356Parse(source, options: TestOptions.RegularWithDocumentationComments, filename: sourcePath),
DocumentationComments\DocumentationModeTests.cs (2)
352Parse(string.Format(sourceTemplate, xml, mode), string.Format("{0}.cs", mode), GetOptions(mode)));
381Parse(string.Format(sourceTemplate, includeElement, mode), string.Format("{0}.cs", mode), GetOptions(mode)));
Symbols\Metadata\PE\NoPia.cs (6)
370var localTypes1 = CSharpCompilation.Create("LocalTypes1", new[] { Parse(localTypes1Source) }, new[] { pia1CopyLink, mscorlibRef });
374var localTypes2 = CSharpCompilation.Create("LocalTypes2", new[] { Parse(localTypes2Source) }, new[] { mscorlibRef, pia1CopyLink });
1009var varC_LocalTypes3 = CSharpCompilation.Create("LocalTypes3", new[] { Parse(localTypes3Source) }, new[] { mscorlibRef, pia1CopyLink });
1106var varC_Pia5 = CSharpCompilation.Create("Pia5", new[] { Parse(pia5Source) }, new[] { mscorlibRef });
1114var varC_Pia1 = CSharpCompilation.Create("Pia1", new[] { Parse(pia1Source) }, new[] { mscorlibRef });
1122var varC_Library2 = CSharpCompilation.Create("Library2", new[] { Parse(library2Source) }, new MetadataReference[] { mscorlibRef, pia1Ref, pia5Ref });
Symbols\SymbolDistinguisherTests.cs (24)
31var tree = Parse(source, "file.cs");
77var libRef = new CSharpCompilationReference(CreateCompilation(Parse(source, "file1.cs"), assemblyName: "Metadata"));
78var comp = CreateCompilation(Parse(source, "file2.cs"), new[] { libRef }, assemblyName: "Source");
95var tree = Parse(source, "file.cs");
115var tree = Parse(source, "file.cs");
135var tree = Parse(source, @"a\..\file.cs");
180var tree = Parse(source, "file.cs");
206var tree = Parse(source, "file.cs");
231var tree = Parse(source, "file.cs");
256var tree = Parse(source, "file.cs");
278var tree = Parse(source, "file.cs");
351CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics(
385CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics(
419CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics(
451CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics(
483CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics(
512CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics(
547CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics(
579var libRef = new CSharpCompilationReference(CreateCompilation(Parse(libSource, "file.cs"), assemblyName: "Metadata"));
580CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics(
612CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics(
649CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics(
680CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics(
782var comp1 = CreateCompilation(Parse(source1), new[] { ref0 });
Symbols\SymbolErrorTests.cs (9)
2114var tree = Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5));
2541var comp = CreateCompilation(Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));
5516comp = CreateCompilation(new SyntaxTree[] { Parse(text, "goo.cs") }, new List<MetadataReference> { ref1 });
16853CreateCompilationWithMscorlib461(new[] { Parse(text, options: TestOptions.Script) }).VerifyDiagnostics(expectedDiagnostics);
17740var tree = Parse(sourceLib, filename: @"C:\lib.cs");
17821var tree = Parse(sourceLib, filename: @"C:\lib.cs");
17856CreateCompilation(new SyntaxTree[] { Parse(text, "goo.cs") }).VerifyDiagnostics(
17886CreateCompilation(new SyntaxTree[] { Parse(text, "goo.cs") }).VerifyDiagnostics(
17945Parse(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));