350 references to Create
InteractiveHost.UnitTests (1)
InteractiveHostDesktopTests.cs (1)
936var lib = CSharpCompilation.Create(
Microsoft.Analyzers.Extra.Tests (4)
SyntaxNodeExtensionsTests.cs (4)
49var compilation = CSharpCompilation.Create( 81var compilation = CSharpCompilation.Create( 144var compilation = CSharpCompilation.Create( 174var compilation = CSharpCompilation.Create(
Microsoft.AspNetCore.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestCompilation.cs (1)
13return CSharpCompilation.Create("Test",
Microsoft.AspNetCore.App.Analyzers.Test (1)
Infrastructure\WellKnownTypesTests.cs (1)
77var compilation = CSharpCompilation.Create(assemblyName, trees).WithOptions(options);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
CSharpCompiler.cs (1)
82return CSharpCompilation.Create(
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
CompilerFailedExceptionFactoryTest.cs (1)
50var compilation = CSharpCompilation.Create("Test", options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
SymbolKey\SymbolKeyErrorTypeTests.cs (1)
387var emptyCompilation = CSharpCompilation.Create("empty", options: new(OutputKind.DynamicallyLinkedLibrary, concurrentBuild: false))
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (55)
CodeGen\CodeGenTupleTest.cs (51)
5788var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 5814var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 5851var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 5868var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 5903var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 5938var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.EmitToImageReference() }); 5946var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 5967var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 5986var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6005var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6023var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6049var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 6075var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6100var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6125var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6151var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6184var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 6208var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, TestReferences.SymbolsTests.netModule.netModule1 }); 6268var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); 6290var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); 6313var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); 6330var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); 6338var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6362var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 6381var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 6411var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6427var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6443var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6458var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6478var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6498var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6519var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); // no ValueTuple 6541var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 6558var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); 6583var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); 6933var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef }); 18841var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18859var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18879var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18902var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18919var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18945var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp1.ToMetadataReference(), tupleComp2.ToMetadataReference() }); 18970var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp1.ToMetadataReference(), tupleComp2.ToMetadataReference() }); 18995var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp1.ToMetadataReference(), tupleComp2.ToMetadataReference() }); 19021var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp1.ToMetadataReference(), tupleComp2.ToMetadataReference() }); 19059var comp = (Compilation)CSharpCompilation.Create("test", syntaxTrees: new[] { tree }, references: new[] { (MetadataReference)Net40.References.mscorlib, tupleComp1.ToMetadataReference() }); 19098var comp = (Compilation)CSharpCompilation.Create("test", syntaxTrees: new[] { tree }, references: new[] { (MetadataReference)Net40.References.mscorlib, tupleComp1.ToMetadataReference() }); 19137var comp = (Compilation)CSharpCompilation.Create("test", syntaxTrees: new[] { tree }, references: new[] { MscorlibRef, tupleComp1.ToMetadataReference() }); 19176var comp = (Compilation)CSharpCompilation.Create("test", syntaxTrees: new[] { tree }, references: new[] { MscorlibRef, tupleComp1.ToMetadataReference() }); 25328var comp = CSharpCompilation.Create("test", references: new[] { libWithVTRef, corlibWithVTRef }); 25338var comp3 = CSharpCompilation.Create("test", references: new[] { corlibWithVTRef, libWithVTRef }) // order reversed
CodeGen\SwitchTests.cs (1)
3040var comp = CSharpCompilation.Create("Name", references: new[] { reference }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal));
Emit\CompilationEmitTests.cs (1)
3462var compilation = CSharpCompilation.Create(
Emit\DeterministicTests.cs (1)
265var compilation = CSharpCompilation.Create("Program",
Emit\ResourceTests.cs (1)
290var c1 = CSharpCompilation.Create("goo", references: new[] { MscorlibRef }, options: TestOptions.ReleaseDll);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (6)
PDB\CheckSumTest.cs (2)
22return CSharpCompilation.Create( 295var comp = CSharpCompilation.Create(
PDB\PDBTests.cs (4)
50var comp = CSharpCompilation.Create("Compilation", new[] { tree1, tree2, tree3, tree4 }, new[] { MscorlibRef }, options: TestOptions.ReleaseDll); 70var comp = CSharpCompilation.Create("Compilation", new[] { tree1, tree2, tree3, tree4 }, new[] { MscorlibRef }, options: TestOptions.ReleaseDll); 140var comp = CSharpCompilation.Create("test", new[] { tree1, tree2 }, TargetFrameworkUtil.StandardReferences, TestOptions.DebugDll); 12308var c = CSharpCompilation.Create("Compilation", new[] { tree }, new[] { MscorlibRef_v46 }, options: TestOptions.DebugDll.WithDebugPlusMode(true));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (10)
Attributes\AttributeTests.cs (3)
4881var metadataStream1 = CSharpCompilation.Create("bar.dll", 4887var metadataStream2 = CSharpCompilation.Create("goo.dll", references: new[] { MscorlibRef, ref1 }, 4896var compilation = CSharpCompilation.Create("moo.dll", references: new[] { MscorlibRef, ref1, ref2 });
Attributes\AttributeTests_Security.cs (2)
1503var compilation = CSharpCompilation.Create( 1625comp = CSharpCompilation.Create(
Attributes\InternalsVisibleToAndStrongNameTests.cs (4)
148comp = CSharpCompilation.Create( 178comp = CSharpCompilation.Create( 307comp = CSharpCompilation.Create( 354comp = CSharpCompilation.Create(
FlowAnalysis\RegionAnalysisTests.cs (1)
5484var comp = CSharpCompilation.Create("FlowAnalysis", syntaxTrees: new[] { tree });
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (2)
InteractiveSessionReferencesTests.cs (2)
526var portableLib = CSharpCompilation.Create( 1114var lib = CSharpCompilation.Create(
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (10)
Semantics\AccessibilityTests.cs (1)
67Symbol symbol = CSharpCompilation.Create(
Semantics\LookupTests.cs (2)
619CSharpCompilation compilation = CSharpCompilation.Create("Test.dll", srcTrees, refs); 676CSharpCompilation compilation = CSharpCompilation.Create("Test.dll", srcTrees, refs);
Semantics\ScriptSemanticsTests.cs (2)
367var compilation = CSharpCompilation.Create( 398var compilation = CSharpCompilation.Create(
Semantics\StructsTests.cs (1)
376var c1 = CSharpCompilation.Create("C1",
Semantics\SyntaxTreeRootTests.cs (3)
62Assert.Throws<ArgumentException>(() => CSharpCompilation.Create("Grrr", syntaxTrees: new[] { arbitraryTree })); 64Assert.Throws<ArgumentException>(() => CSharpCompilation.Create("Bahh", syntaxTrees: new[] { parsedTree }).ReplaceSyntaxTree(parsedTree, arbitraryTree)); 65Assert.Throws<ArgumentException>(() => CSharpCompilation.Create("Woo").GetSemanticModel(arbitraryTree));
SourceGeneration\StateTableTests.cs (1)
1345var c = CSharpCompilation.Create("empty");
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (199)
Compilation\CompilationAPITests.cs (95)
241var comp = CSharpCompilation.Create("test", options: options); 276CSharpCompilation.Create(@"C:/goo/Test.exe").VerifyEmitDiagnostics( 284CSharpCompilation.Create(@"C:\goo\Test.exe").GetDeclarationDiagnostics().Verify( 289CSharpCompilation.Create(@"\goo/Test.exe", options: compilationOptions).VerifyEmitDiagnostics( 293CSharpCompilation.Create(@"C:Test.exe", options: compilationOptions).VerifyEmitDiagnostics( 297CSharpCompilation.Create(@"Te\0st.exe", options: compilationOptions).VerifyEmitDiagnostics( 301CSharpCompilation.Create(@" \t ", options: compilationOptions).VerifyEmitDiagnostics( 305CSharpCompilation.Create(@"\uD800", options: compilationOptions).VerifyEmitDiagnostics( 309CSharpCompilation.Create(@"", options: compilationOptions).VerifyEmitDiagnostics( 313CSharpCompilation.Create(@" a", options: compilationOptions).VerifyEmitDiagnostics( 317CSharpCompilation.Create(@"\u2000a", options: compilationOptions).VerifyEmitDiagnostics( // U+20700 is whitespace 321CSharpCompilation.Create("..\\..\\RelativePath", options: compilationOptions).VerifyEmitDiagnostics( 327CSharpCompilation.Create(@";,*?<>#!@&", options: compilationOptions).VerifyEmitDiagnostics(); 328CSharpCompilation.Create("goo", options: compilationOptions).VerifyEmitDiagnostics(); 329CSharpCompilation.Create(".goo", options: compilationOptions).VerifyEmitDiagnostics(); 330CSharpCompilation.Create("goo ", options: compilationOptions).VerifyEmitDiagnostics(); // can end with whitespace 331CSharpCompilation.Create("....", options: compilationOptions).VerifyEmitDiagnostics(); 332CSharpCompilation.Create(null, options: compilationOptions).VerifyEmitDiagnostics(); 360var comp = CSharpCompilation.Create("Compilation", listSyntaxTree, listRef, ops); 375comp = CSharpCompilation.Create(asmname, listSyntaxTree, listRef, ops); 376var comp1 = CSharpCompilation.Create(asmname, listSyntaxTree, listRef, null); 385var c = CSharpCompilation.Create("a", 444var comp = CSharpCompilation.Create("Compilation", options: TestOptions.ReleaseDll); 489var comp = CSharpCompilation.Create("Compilation", options: TestOptions.DebugExe); 519var compCollection = CSharpCompilation.Create("Compilation", references: hs, options: opt); 527compCollection = CSharpCompilation.Create("Compilation", references: col, options: opt); 538compCollection = CSharpCompilation.Create("Compilation", references: stack, options: opt); 549compCollection = CSharpCompilation.Create("Compilation", references: queue, options: opt); 612var refcomp = CSharpCompilation.Create("DLL", 620var comp = CSharpCompilation.Create("APP", 631comp = CSharpCompilation.Create("APP1", 644comp = CSharpCompilation.Create("APP2", 680var refcomp = CSharpCompilation.Create("DLL", 688var comp = CSharpCompilation.Create("APP", 699comp = CSharpCompilation.Create("APP1", 712comp = CSharpCompilation.Create("APP2", 791var comp = CSharpCompilation.Create("Compilation", syntaxTrees: new[] { SyntaxFactory.ParseSyntaxTree(s1) }, options: TestOptions.ReleaseDll); 846var compCollection = CSharpCompilation.Create("Compilation", syntaxTrees: hs); 854compCollection = CSharpCompilation.Create("Compilation", syntaxTrees: col); 865compCollection = CSharpCompilation.Create("Compilation", syntaxTrees: stack); 876compCollection = CSharpCompilation.Create("Compilation", syntaxTrees: queue); 914Assert.Throws<ArgumentException>(() => CSharpCompilation.Create("Compilation", new SyntaxTree[] { withExpressionRootTree })); 938CSharpCompilation comp = CSharpCompilation.Create(options: TestOptions.ReleaseDll, assemblyName: "Compilation", references: null, syntaxTrees: null); 964CSharpCompilation comp1 = CSharpCompilation.Create(assemblyName: "Compilation", syntaxTrees: null, options: TestOptions.ReleaseDll, references: null); 1164var comp = CSharpCompilation.Create("Compilation"); 1177var comp1 = CSharpCompilation.Create("Test1", new[] { SyntaxFactory.ParseSyntaxTree(text1) }); 1178var comp2 = CSharpCompilation.Create("Test2", new[] { SyntaxFactory.ParseSyntaxTree(text1) }); 1189comp = CSharpCompilation.Create( 1321var comp = CSharpCompilation.Create("Compilation"); 1341Assert.Throws<ArgumentNullException>(() => CSharpCompilation.Create("goo", syntaxTrees: new SyntaxTree[] { null })); 1342Assert.Throws<ArgumentNullException>(() => CSharpCompilation.Create("goo", references: new MetadataReference[] { null })); 1350var comp = CSharpCompilation.Create("Compilation"); 1378var comp = CSharpCompilation.Create("Compilation"); 1414var comp = CSharpCompilation.Create("Compilation"); 1436var comp = CSharpCompilation.Create("Compilation"); 1452var comp = CSharpCompilation.Create("Compilation"); 1474var comp = CSharpCompilation.Create("Compilation"); 1498var comp = CSharpCompilation.Create("Compilation"); 1507var comp = CSharpCompilation.Create("Compilation"); 1540var comp = CSharpCompilation.Create("API"); 1554var comp = CSharpCompilation.Create("Compilation"); 1563var comp = CSharpCompilation.Create("Compilation"); 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 }); 1884var comp = CSharpCompilation.Create("Compilation"); 1967var c1 = CSharpCompilation.Create("c", options: TestOptions.ReleaseDll); 1981c1 = CSharpCompilation.Create("c", options: TestOptions.ReleaseModule); 1999var c1 = CSharpCompilation.Create("c", options: TestOptions.ReleaseDll); 2012var c1 = CSharpCompilation.Create("c", options: TestOptions.ReleaseDll); 2024var c1 = CSharpCompilation.Create("c1"); 2042var c1 = CSharpCompilation.Create("c1"); 2083var a = CSharpCompilation.Create("c", syntaxTrees: new[] { ta }); 2237var c = CSharpCompilation.Create("Goo", references: new[] { MscorlibRef, mdModule.GetReference(display: "ModuleCS00") }, options: TestOptions.ReleaseDll); 2349var comp = CSharpCompilation.Create("Compilation"); 2356var comp2 = CSharpCompilation.Create("Compilation"); 2385CSharpCompilation.Create(assemblyName, new[] { tree1, tree2 }, new[] { MscorlibRef }, compilationOptions); 2388CSharpCompilation.Create(assemblyName, new[] { tree1, tree3 }, new[] { MscorlibRef }, compilationOptions); 2460var comp = (Compilation)CSharpCompilation.Create(""); 2489var comp = (Compilation)CSharpCompilation.Create(""); 2507var compilation = CSharpCompilation.Create("HelloWorld"); 2517var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2529var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2541var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2553var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2565var compilation = CSharpCompilation.Create("HelloWorld"); 2575var compilation = CSharpCompilation.Create("HelloWorld"); 2585var compilation = CSharpCompilation.Create("HelloWorld"); 2595var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2605var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2620var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2641var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2657var comp = (Compilation)CSharpCompilation.Create(""); 2687var comp = (Compilation)CSharpCompilation.Create(""); 2697var comp = (Compilation)CSharpCompilation.Create("");
Compilation\ReferenceManagerTests.cs (6)
930var compilation = CSharpCompilation.Create("goo", options: TestOptions.ReleaseDll, 999var compilation = CSharpCompilation.Create("goo", references: new[] { r1, r2 }); 1017var comp = CSharpCompilation.Create( 1274var c1 = CSharpCompilation.Create("c1", 1334var c1 = CSharpCompilation.Create("goo", 2137var compilation = CSharpCompilation.Create("test", references: new[] { md.GetReference() });
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
2752var compilation = CSharpCompilation.Create(
DeclarationTests.cs (1)
260var comp = CSharpCompilation.Create(
DocumentationComments\DocumentationCommentCompilerTests.cs (1)
3660var comp = CSharpCompilation.Create("Test", new[] { tree }, new[] { MscorlibRef }, TestOptions.ReleaseDll.WithXmlReferenceResolver(resolver));
Symbols\AssemblyAndNamespaceTests.cs (7)
117var comp1 = CSharpCompilation.Create(assemblyName: "Test", options: TestOptions.DebugExe, 121var comp = CSharpCompilation.Create(assemblyName: "Test1", options: TestOptions.DebugExe, 164var comp = CSharpCompilation.Create(assemblyName: "Test1", options: TestOptions.DebugExe, 251var comp1 = CSharpCompilation.Create(assemblyName: "Test1", options: TestOptions.DebugExe, syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text1) }, references: new MetadataReference[] { }); 252var comp2 = CSharpCompilation.Create(assemblyName: "Test2", options: TestOptions.DebugExe, syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text2) }, references: new MetadataReference[] { }); 257var comp = CSharpCompilation.Create(assemblyName: "Test3", options: TestOptions.DebugExe, 298var comp = CSharpCompilation.Create(
Symbols\CompilationCreationTests.cs (13)
72var c1 = CSharpCompilation.Create("Test", references: new MetadataReference[] { MscorlibRef_v4_0_30316_17626, mdTestLib1 }); 101var c2 = CSharpCompilation.Create("Test", references: new[] { mdTestLib1 }); 112var tc1 = CSharpCompilation.Create("Cyclic1", references: new[] { mscorlibRef, cyclic2Ref }); 2618CSharpCompilation c = CSharpCompilation.Create("Test"); 2862var compilation = CSharpCompilation.Create("foo", references: new[] { MscorlibRef, r }, syntaxTrees: new[] { st }); 2879var compilation1 = CSharpCompilation.Create("Compilation1", syntaxTrees: treeOrder1); 2883var compilation2 = CSharpCompilation.Create("Compilation2", syntaxTrees: treeOrder2); 2896var compilation1 = CSharpCompilation.Create("Compilation1", syntaxTrees: treeList1); 2905var compilation3 = CSharpCompilation.Create("Compilation3", syntaxTrees: treeList3); 2923var compilation1 = CSharpCompilation.Create("Compilation1", syntaxTrees: treeList1); 2932var compilation3 = CSharpCompilation.Create("Compilation3", syntaxTrees: treeList3); 2949var compilation1 = CSharpCompilation.Create("Compilation1", syntaxTrees: treeList1); 2957var compilation3 = CSharpCompilation.Create("Compilation3", syntaxTrees: treeList3);
Symbols\ConversionTests.cs (3)
26var compilation = CSharpCompilation.Create("Test", references: new MetadataReference[] { mscorlibRef }); 227var compilation = CSharpCompilation.Create("Test", new[] { Parse(code) }, new[] { mscorlibRef }); 386var compilation = (Compilation)CSharpCompilation.Create("MyCompilation")
Symbols\CorLibrary\CorTypes.cs (1)
187var c1 = CSharpCompilation.Create("CorLib", syntaxTrees: new[] { Parse(source) });
Symbols\ExtensionMethodTests.cs (1)
2425var compilation = CSharpCompilation.Create(
Symbols\Metadata\PE\BaseTypeResolution.cs (2)
311var c1 = CSharpCompilation.Create("Test", references: new MetadataReference[] { mscorlibRef }); 317var c2 = CSharpCompilation.Create("Test2", references: new MetadataReference[] { localMTTestLib1Ref });
Symbols\Metadata\PE\LoadingNamespacesAndTypes.cs (2)
381var compilation = CSharpCompilation.Create("C1", references: 398var compilation = CSharpCompilation.Create("C1", references:
Symbols\Metadata\PE\NoPia.cs (40)
370var localTypes1 = CSharpCompilation.Create("LocalTypes1", new[] { Parse(localTypes1Source) }, new[] { pia1CopyLink, mscorlibRef }); 374var localTypes2 = CSharpCompilation.Create("LocalTypes2", new[] { Parse(localTypes2Source) }, new[] { mscorlibRef, pia1CopyLink }); 692var tc1 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref }); 695var tc2 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref }); 762var tc1 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, pia5Link }); 772var tc2 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, pia5Ref }); 782var tc3 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Ref }); 796var tc4 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, library2Ref, pia5Ref, pia1Ref }); 812var tc5 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Link }); 830var tc6 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Ref }); 843var tc7 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, library2Link, pia5Link, pia1Ref }); 882var tc1 = CSharpCompilation.Create("C1", references: new MetadataReference[] { varmscorlibRef, varCRef, varARef, varBLink }); 888var tc2 = CSharpCompilation.Create("C2", references: new MetadataReference[] { varmscorlibRef, varCRef, varARef, varDRef, varBLink }); 896var tc3 = CSharpCompilation.Create("C3", references: new MetadataReference[] { varmscorlibRef, varCRef, varBLink }); 901var tc4 = CSharpCompilation.Create("C4", references: new MetadataReference[] { varmscorlibRef, varCRef, varARef, varBRef }); 911var tc5 = CSharpCompilation.Create("C5", references: new MetadataReference[] { varmscorlibRef, varCRef, varALink, varBLink }); 922var tc6 = CSharpCompilation.Create("C6", references: new MetadataReference[] { varmscorlibRef, varARef, varBLink, varCLink }); 933var tc7 = CSharpCompilation.Create("C7", references: new MetadataReference[] { varmscorlibRef, varCRef, varARef }); 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 }); 1129var tc1 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, pia5Link }); 1139var tc2 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, pia5Ref }); 1149var tc3 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Ref }); 1163var tc4 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Ref, pia5Ref, pia1Ref }); 1179var tc5 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Link }); 1197var tc6 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Ref }); 1210var tc7 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Link, pia5Link, pia1Ref }); 1267var varC_A = CSharpCompilation.Create("A", references: new[] { mscorlibRef }); 1272var varC_B = CSharpCompilation.Create("B", references: new[] { mscorlibRef }); 1277var varC_C = CSharpCompilation.Create("C", references: new MetadataReference[] { mscorlibRef, varARef, varBRef }); 1282var varC_D = CSharpCompilation.Create("D", references: new MetadataReference[] { mscorlibRef }); 1287var tc1 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, varCRef, varARef, varBLink }); 1293var tc2 = CSharpCompilation.Create("C2", references: new MetadataReference[] { mscorlibRef, varCRef, varARef, varDRef, varBLink }); 1301var tc3 = CSharpCompilation.Create("C3", references: new MetadataReference[] { mscorlibRef, varCRef, varBLink }); 1306var tc4 = CSharpCompilation.Create("C4", references: new MetadataReference[] { mscorlibRef, varCRef, varARef, varBRef }); 1316var tc5 = CSharpCompilation.Create("C5", references: new MetadataReference[] { mscorlibRef, varCRef, varALink, varBLink }); 1327var tc6 = CSharpCompilation.Create("C6", references: new MetadataReference[] { mscorlibRef, varARef, varBLink, varCLink }); 1338var tc7 = CSharpCompilation.Create("C7", references: new MetadataReference[] { mscorlibRef, varCRef, varARef });
Symbols\MockSymbolTests.cs (2)
24CSharpCompilation compilation = CSharpCompilation.Create("Test"); 97CSharpCompilation compilation = CSharpCompilation.Create("Test");
Symbols\Retargeting\NoPia.cs (6)
1263var tc1 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref }); 1266var tc2 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref }); 1289var tc1 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref }); 1292var tc2 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref }); 1319var tc1 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref }); 1322var tc2 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref });
Symbols\Retargeting\RetargetCustomAttributes.cs (2)
69var compilation1 = CSharpCompilation.Create("C1", new[] { Parse(source) }, new[] { OldMsCorLib }, TestOptions.ReleaseDll); 74var compilation2 = CSharpCompilation.Create("C2", references: new MetadataReference[] { NewMsCorLib, c1 });
Symbols\Retargeting\RetargetCustomModifiers.cs (3)
29var c1 = CSharpCompilation.Create("C1", references: new[] 37CSharpCompilation c2 = CSharpCompilation.Create("C2", references: new MetadataReference[] { newMsCorLib, new CSharpCompilationReference(c1) }); 147CSharpCompilation c1 = CSharpCompilation.Create("C1", new[] { Parse(source) }, new[] { oldMsCorLib });
Symbols\Source\PropertyTests.cs (2)
2604var refComp = CSharpCompilation.Create("DLL", 2696refComp = CSharpCompilation.Create("DLL",
Symbols\Source\SourcePlusMetadataTests.cs (3)
191var comp2 = CSharpCompilation.Create("Compilation2", references: new MetadataReference[] { ref2, MscorlibRef }); 207var comp2 = CSharpCompilation.Create("Compilation2", references: new MetadataReference[] { ref2, MscorlibRef }); 235var comp2 = CSharpCompilation.Create("Compilation2", references: new MetadataReference[] { ref2, MscorlibRef });
Symbols\TypeResolutionTests.cs (8)
50var c1 = CSharpCompilation.Create("Test1", 64var c2 = CSharpCompilation.Create("Test2", 75var c3 = CSharpCompilation.Create("Test3", 88var c4 = CSharpCompilation.Create("Test4", 118var c = CSharpCompilation.Create("TypeSymbolFromReflectionType", 168var c1 = CSharpCompilation.Create("Asm1", syntaxTrees: new[] { SyntaxFactory.ParseSyntaxTree(code) }); 169var c2 = CSharpCompilation.Create("Asm2", syntaxTrees: new[] { SyntaxFactory.ParseSyntaxTree(code) }); 183var c1 = CSharpCompilation.Create("Asm1",
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
LexicalAndXml\PreprocessorTests.cs (1)
3890var comp = CSharpCompilation.Create("Test", syntaxTrees: new[] { tree });
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
CSharpTestBase.cs (2)
1313Func<CSharpCompilation> createCompilationLambda = () => CSharpCompilation.Create( 1443Func<CSharpCompilation> createCompilationLambda = () => CSharpCompilation.Create(identity.Name, options: options ?? TestOptions.ReleaseDll, references: references, syntaxTrees: trees);
DiagnosticTestUtilities.cs (1)
85var comp = CSharpCompilation.Create(assemblyName: "DiagnosticsTest", options: TestOptions.ReleaseDll, syntaxTrees: synTrees, references: refs);
MetadataTestHelpers.cs (1)
71var tc1 = CSharpCompilation.Create(assemblyName: "Dummy", options: options ?? TestOptions.ReleaseDll, syntaxTrees: new SyntaxTree[0], references: refs);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (5)
PdbTests.cs (5)
21var comp = CSharpCompilation.Create("Compilation", options: TestOptions.ReleaseDll); 75var c = CSharpCompilation.Create("a", 91var c = CSharpCompilation.Create("a", 108var c = CSharpCompilation.Create("a", 120var comp = CSharpCompilation.Create("Compilation", null, null, ops);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Diagnostics\CSharpDiagnosticPropertiesService.cs (1)
17private static readonly Compilation s_compilation = CSharpCompilation.Create("empty");
Workspace\LanguageServices\CSharpCompilationFactoryService.cs (1)
28return CSharpCompilation.Create(
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
43return CSharpCompilation.Create("test") 3998var comp = CSharpCompilation.Create("test")
Microsoft.CodeAnalysis.Rebuild (1)
CSharpCompilationFactory.cs (1)
50=> CSharpCompilation.Create(
Microsoft.CodeAnalysis.Rebuild.UnitTests (2)
CSharpDeterministicKeyBuilderTests.cs (2)
36CSharpCompilation.Create( 425var utilCompilation = CSharpCompilation.Create(
Microsoft.CodeAnalysis.Scripting.TestUtilities (2)
TestCompilationFactory.cs (2)
22return CSharpCompilation.Create( 40return CSharpCompilation.Create(
Microsoft.CodeAnalysis.Test.Utilities (5)
AssemblyLoadTestFixture.cs (1)
530var analyzerDependencyCompilation = CSharpCompilation.Create(
CommonTestBase.cs (1)
390var compilation = CSharp.CSharpCompilation.Create(assemblyName, new[] { tree }, references, compilationOptions);
Compilation\CompilationExtensions.cs (1)
508var compilation = CSharpCompilation.Create(
Platform\Desktop\TestHelpers.cs (1)
80var analyzerCompilation = CSharpCompilation.Create(
TestBase.cs (1)
196var compilation = CSharpCompilation.Create("aacorlib.v15.0.3928.dll", new[] { syntaxTree }, null, compilationOptions);
Microsoft.CodeAnalysis.UnitTests (22)
Analyzers\AnalyzerFileReferenceAppDomainTests.cs (1)
92var analyzerCompilation = CSharp.CSharpCompilation.Create(
Analyzers\AnalyzerFileReferenceTests.cs (1)
484var compilation = CSharpCompilation.Create($"generator_{targetFramework}",
CommonTypedConstantTests.cs (1)
29_compilation = (CSharp.CSharpCompilation)CSharp.CSharpCompilation.Create("class C {}");
CorLibTypesTests.cs (1)
67var comp = CSharp.CSharpCompilation.Create(
Diagnostics\AnalysisContextInfoTests.cs (1)
115return CSharpCompilation.Create(
Diagnostics\CompilationWithAnalyzersTests.cs (2)
28var c = CSharpCompilation.Create("c"); 58var compilation = CSharpCompilation.Create("c", options: s_dllWithMaxWarningLevel);
Diagnostics\DiagnosticLocalizationTests.cs (1)
306var compilation = CSharp.CSharpCompilation.Create("test");
Diagnostics\OperationTests.cs (1)
275var compilation = CSharpCompilation.Create("c", new[] { tree });
Diagnostics\SuppressMessageAttributeCompilerTests.cs (2)
58var compRef = CSharpCompilation.Create("unconditionalsuppress", 79return CSharpCompilation.Create(
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (1)
1431return CSharpCompilation.Create(
Emit\EmitBaselineTests.cs (1)
26var compilation = CSharpCompilation.Create("test");
Emit\SemanticEditTests.cs (1)
21var c = CSharpCompilation.Create("name", references: new[] { TestReferences.NetFx.Minimal.mincorlib });
GivesAccessTo.cs (2)
44var csc = (Compilation)CSharpCompilation.Create("CS", new[] { csharpTree }, new MetadataReference[] { TestBase.MscorlibRef }); 47var csc2 = (Compilation)CSharpCompilation.Create("CS2", new[] { csharpTree2 }, new MetadataReference[] { TestBase.MscorlibRef });
IsSymbolAccessibleWithinTests.cs (1)
28var csc = CSharpCompilation.Create("CS", new[] { csharpTree }, new MetadataReference[] { TestBase.MscorlibRef }) as Compilation;
MetadataReferences\MetadataReferenceTests.cs (5)
339var c = CSharpCompilation.Create("cs"); 448r = CS.CSharpCompilation.Create("compilation name").ToMetadataReference(); 539var c1a = CS.CSharpCompilation.Create("goo").ToMetadataReference(); 541var c2 = CS.CSharpCompilation.Create("goo").ToMetadataReference(); 571var comp = (Compilation)CS.CSharpCompilation.Create("goo",
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (3)
Compilation\CompilationAPITests.vb (3)
1034Dim csComp = CS.CSharpCompilation.Create("CompilationVB") 1321Dim csComp = CS.CSharpCompilation.Create("CompilationCS") 1392Dim csComp = CS.CSharpCompilation.Create("CompilationVB")
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
Host\LanguageServices\TestCSharpCompilationFactoryServiceWithIncrementalGeneratorTracking.cs (1)
30return CSharpCompilation.Create(
UtilityTest\DocumentationCommentIdTests.cs (1)
20return CSharpCompilation.Create("goo.exe").AddReferences(NetFramework.mscorlib).AddSyntaxTrees(syntaxTree);
Microsoft.Gen.Logging.Unit.Tests (1)
CompilationHelper.cs (1)
47return CSharpCompilation.Create(
Mvc.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestCompilation.cs (1)
13return CSharpCompilation.Create("Test",
StackDepthTest (1)
Program.cs (1)
81var comp = CSharpCompilation.Create("assemblyName", new SyntaxTree[] { tree }, references: new MetadataReference[] { reference }, options: options);
System.Windows.Forms.Design.Tests (1)
System\Resources\Tools\CodeDomCompileHelper.cs (1)
34CSharpCompilation compilation = CSharpCompilation.Create(
System.Windows.Forms.PrivateSourceGenerators.Tests (1)
EnumValidationTests.cs (1)
303CSharpCompilation compilation = CSharpCompilation.Create("original", new SyntaxTree[] { syntaxTree }, references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
VBCSCompiler.UnitTests (1)
AnalyzerConsistencyCheckerTests.cs (1)
65var comp = CSharpCompilation.Create(
WinShimmer (1)
Program.cs (1)
44var compilation = CSharpCompilation.Create(shimName)