927 references to CreateEmptyCompilation
InteractiveHost.UnitTests (1)
AbstractInteractiveHostTests.cs (1)
197var compilation = CreateEmptyCompilation(
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (3)
CommandLineTests.cs (3)
9554var comp = CreateEmptyCompilation(string.Empty, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 9557comp = CreateEmptyCompilation(string.Empty, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 13548var comp = CreateEmptyCompilation(source: generatorSource,
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (3)
229var comp20 = (Compilation)CreateEmptyCompilation(src1, new[] { Net40.mscorlib }); 327var comp20 = CreateEmptyCompilation(src1, new[] { Net40.mscorlib }); 409var comp20 = CreateEmptyCompilation(src1, new[] { Net40.mscorlib });
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (214)
CodeGen\CodeGenAsyncMainTests.cs (4)
362var corCompilation = CreateEmptyCompilation(corAssembly, options: TestOptions.DebugDll); 381var sourceCompilation = CreateEmptyCompilation(source, new[] { corCompilation.ToMetadataReference(), taskCompilation.ToMetadataReference() }, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 402var corCompilation = CreateEmptyCompilation(corAssembly, options: TestOptions.DebugDll); 421var sourceCompilation = CreateEmptyCompilation(source, new[] { corCompilation.ToMetadataReference(), taskCompilation.ToMetadataReference() }, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1));
CodeGen\CodeGenAsyncTests.cs (4)
3307var comp = CSharpTestBase.CreateEmptyCompilation(source, new[] { Net40.mscorlib }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers. 3337var comp = CSharpTestBase.CreateEmptyCompilation(source, new[] { Net40.mscorlib }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers. 3368var comp = CSharpTestBase.CreateEmptyCompilation(source, new[] { Net40.mscorlib }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers. 4987var compilation = CreateEmptyCompilation(new[] { Parse(source) });
CodeGen\CodeGenDeconstructTests.cs (2)
7834var comp1 = CreateEmptyCompilation(source1, WinRtRefs, TestOptions.ReleaseWinMD, TestOptions.Regular); 7881var comp1 = CreateEmptyCompilation(source1, WinRtRefs, TestOptions.ReleaseWinMD, TestOptions.Regular);
CodeGen\CodeGenExprLambdaTests.cs (4)
3512var comp = CreateEmptyCompilation( 5303var compilation = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 5365var compilation = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 5438var compilation = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
CodeGen\CodeGenFunctionPointersTests.cs (8)
7550var allInCoreLib = CreateEmptyCompilation(source1 + source2, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 7567var coreLib = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 7570var comp1 = CreateEmptyCompilation(source2, references: new[] { coreLib.EmitToImageReference() }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 7619var allInCoreLib = CreateEmptyCompilation(source1 + source2, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 7636var coreLib = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 7639var comp1 = CreateEmptyCompilation(source2, references: new[] { coreLib.EmitToImageReference() }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 7861var comp = CreateEmptyCompilation(new[] { @" 7901var comp = CreateEmptyCompilation(new[] { @"
CodeGen\CodeGenIterators.cs (3)
2390var compilation = CreateEmptyCompilation(new[] { Parse(source, options: parseOptions), Parse(corlib, options: parseOptions) }); 2435var compilation = CreateEmptyCompilation(new[] { Parse(source, options: TestOptions.Regular.WithNoRefSafetyRulesAttribute()) }); 2499var compilation = CreateEmptyCompilation(new[] { Parse(source, options: TestOptions.Regular.WithNoRefSafetyRulesAttribute()) });
CodeGen\CodeGenLockTests.cs (1)
1744return CreateEmptyCompilation(new string[] { text }, new[] { TestMetadata.Net20.mscorlib });
CodeGen\CodeGenMscorlib.cs (21)
153var c = CreateEmptyCompilation(text, options: TestOptions.UnsafeReleaseDll); 204CreateEmptyCompilation( 223var compilation = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 247var compilation1 = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName()); 257var compilation2 = CreateEmptyCompilation(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 }); 281var compilation1 = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName()); 298var compilation2 = CreateEmptyCompilation(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 }); 318var compilation1 = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName()); 335var compilation2 = CreateEmptyCompilation(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 }); 356var compilation1 = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName()); 374var compilation2 = CreateEmptyCompilation(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 }); 415var compilation1 = CreateEmptyCompilation(source1, assemblyName: GetUniqueName()); 433var compilation2 = CreateEmptyCompilation(source2, new[] { reference1 }); 477var compilation1 = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName()); 490var compilation2 = CreateEmptyCompilation(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 }); 547CreateEmptyCompilation( 612var comp = CreateEmptyCompilation( 750var comp = CreateEmptyCompilation( 880var comp = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll).VerifyDiagnostics(); 1037var comp = CreateEmptyCompilation(text, options: TestOptions.UnsafeReleaseDll); 1163var comp = CreateEmptyCompilation(text, options: TestOptions.UnsafeReleaseDll);
CodeGen\CodeGenTests.cs (5)
476var compilation = CreateEmptyCompilation(tree, new[] { MscorlibRefSilverlight }, TestOptions.ReleaseExe, assemblyName: "Test"); 10521CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()).VerifyEmitDiagnostics( 14547var compilation = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 14581var compilation = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 14617var compilation = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
CodeGen\CodeGenTupleEqualityTests.cs (1)
2649var comp = CreateEmptyCompilation(source);
CodeGen\CodeGenTupleTest.cs (38)
4100var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7), 25354var corlibWithoutVT = CreateEmptyCompilation(new[] { Parse(String.Format(versionTemplate, "1") + corlib_cs, options: parseOptions) }, assemblyName: "corlib"); 25358var corlibWithVT = CreateEmptyCompilation(new[] { Parse(String.Format(versionTemplate, "2") + corlib_cs + valuetuple_cs, options: parseOptions) }, assemblyName: "corlib"); 25362var libWithVT = CreateEmptyCompilation(valuetuple_cs, references: new[] { corlibWithoutVTRef }, parseOptions: parseOptions, options: TestOptions.DebugDll); 25382var libWithVTRef2 = CreateEmptyCompilation(valuetuple_cs, references: new[] { corlibWithoutVTRef }, parseOptions: parseOptions).EmitToImageReference(); 25383var comp4 = CreateEmptyCompilation("", references: new[] { libWithVTRef, libWithVTRef2, corlibWithoutVTRef }, parseOptions: parseOptions); 25726var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25771var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25797var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25842var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25868var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25907var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25940var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 26707var vtLib = CreateEmptyCompilation(trivial2uple + tupleattributes_cs, references: new[] { MscorlibRef }, assemblyName: "vt"); 26719var lib = CreateEmptyCompilation(lib_cs, references: new[] { MscorlibRef, vtLib.EmitToImageReference() }); 26730var comp = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to vt 26734var compWithMetadataReference = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.ToMetadataReference() }); // missing reference to vt 26738var fakeVtLib = CreateEmptyCompilation("", references: new[] { MscorlibRef }, assemblyName: "vt"); 26739var compWithFakeVt = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeVtLib.EmitToImageReference() }); // reference to fake vt 26754var comp2 = CreateEmptyCompilation(client2_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to vt 26765var comp2WithFakeVt = CreateEmptyCompilation(client2_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeVtLib.EmitToImageReference() }); // reference to fake vt 26809var vtLib = CreateEmptyCompilation(tuplelib_cs + tupleattributes_cs, references: new[] { MscorlibRef }, assemblyName: "vt"); 26821var lib = CreateEmptyCompilation(lib_cs, references: new[] { MscorlibRef, vtLib.EmitToImageReference() }); 26835var fakeVtLib = CreateEmptyCompilation("", references: new[] { MscorlibRef }, assemblyName: "vt"); 26836var comp = CreateEmptyCompilation(client2_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to vt 26847var compWithFakeVt = CreateEmptyCompilation(client2_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeVtLib.EmitToImageReference() }); // reference to fake vt 26873var containerLib = CreateEmptyCompilation("public class Container<T> { }", references: new[] { MscorlibRef }, assemblyName: "container"); 26885var lib = CreateEmptyCompilation(lib_cs + tuplelib_cs + tupleattributes_cs, references: new[] { MscorlibRef, containerLib.EmitToImageReference() }); 26896var comp = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to container 26900var compWithMetadataReference = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.ToMetadataReference() }); // missing reference to container 26904var fakeContainerLib = CreateEmptyCompilation("", references: new[] { MscorlibRef }, assemblyName: "container"); 26905var compWithFakeContainer = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeContainerLib.EmitToImageReference() }); // reference to fake container 26948var containerLib = CreateEmptyCompilation("public class Container<T> { public class Contained<U> { } }", references: new[] { MscorlibRef }, assemblyName: "container"); 26960var lib = CreateEmptyCompilation(lib_cs + tuplelib_cs + tupleattributes_cs, references: new[] { MscorlibRef, containerLib.EmitToImageReference() }); 26971var comp = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to container 26975var compWithMetadataReference = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.ToMetadataReference() }); // missing reference to container 26979var fakeContainerLib = CreateEmptyCompilation("", references: new[] { MscorlibRef }, assemblyName: "container"); 26980var compWithFakeContainer = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeContainerLib.EmitToImageReference() }); // reference to fake container
CodeGen\EventTests.cs (2)
646var compilation1 = CreateEmptyCompilation(source1, assemblyName: GetUniqueName(), parseOptions: parseOptions); 664var compilation2 = CreateEmptyCompilation(source2, new[] { reference1 }, parseOptions: parseOptions);
CodeGen\ForeachTest.cs (1)
630var comp = CreateEmptyCompilation(@"
CodeGen\PatternTests.cs (5)
99var compilation = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.ReleaseDll); 122var compilation = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 152var compilation = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 200var compilation = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 3315var compilation = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.ReleaseDll);
CodeGen\SwitchTests.cs (1)
4512var comp = CreateEmptyCompilation(
CodeGen\WinMdDelegateTests.cs (2)
142var winRtDelegateLibrary = CreateEmptyCompilation( 150var nonWinRtDelegateLibrary = CreateEmptyCompilation(
Emit\CompilationEmitTests.cs (67)
896var compWithMetadata = CreateEmptyCompilation("", references: new[] { MscorlibRef, metadataRef }, 1309CSharpCompilation moduleComp = CreateEmptyCompilation("", 2123CSharpCompilation comp = CreateEmptyCompilation(source, references: new[] { MscorlibRef }, 2132var compWithReal = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage }, 2163var compWithReal2 = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage2 }, 2191var compWithMetadata = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, metadataImage }, 2220var compWithRef = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage }, 2262CSharpCompilation comp = CreateEmptyCompilation(source, parseOptions: parseOptions, references: new[] { MscorlibRef }, 2269var compWithReal = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage }, 2279var compWithMetadata = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, metadataImage }, 2291var compWithRef = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage }, 2329CSharpCompilation comp = CreateEmptyCompilation(source, parseOptions: parseOptions, references: new[] { MscorlibRef }, 2336var compWithReal = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage }, 2346var compWithMetadata = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, metadataImage }, 2358var compWithRef = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage }, 2396CSharpCompilation comp = CreateEmptyCompilation(source, parseOptions: parseOptions, references: new[] { MscorlibRef }, 2403var compWithReal = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage }, 2413var compWithMetadata = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, metadataImage }, 2425var compWithRef = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage }, 2456CSharpCompilation comp = CreateEmptyCompilation(source, parseOptions: parseOptions, references: new[] { MscorlibRef }, 2464var compWithRef = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage }, 2501CSharpCompilation comp = CreateEmptyCompilation(source, parseOptions: parseOptions, references: new[] { MscorlibRef }, 2509var compWithRef = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage }, 2523CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2537CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2551CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2566CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2579CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2593CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2606CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2632CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2652CSharpCompilation comp = CreateEmptyCompilation(source, references: new[] { MscorlibRef }, 4673var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(Platform.Itanium), assemblyName: "PlatformMismatch"); 4685var useCompilation = CreateEmptyCompilation(useSource, 4691useCompilation = CreateEmptyCompilation(useSource, 4697useCompilation = CreateEmptyCompilation(useSource, 4703useCompilation = CreateEmptyCompilation(useSource, 4709useCompilation = CreateEmptyCompilation(useSource, 4717useCompilation = CreateEmptyCompilation(useSource, 4725useCompilation = CreateEmptyCompilation(useSource, 4733useCompilation = CreateEmptyCompilation(useSource, 4758var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(Platform.Itanium), assemblyName: "PlatformMismatch"); 4769var useCompilation = CreateEmptyCompilation(useSource, 4777useCompilation = CreateEmptyCompilation(useSource, 4785useCompilation = CreateEmptyCompilation(useSource, 4803var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(Platform.X86), assemblyName: "PlatformMismatch"); 4816var useCompilation = CreateEmptyCompilation(useSource, 4824useCompilation = CreateEmptyCompilation(useSource, 4832useCompilation = CreateEmptyCompilation(useSource, 4840useCompilation = CreateEmptyCompilation(useSource, 4859var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(Platform.X86), assemblyName: "PlatformMismatch"); 4871var useCompilation = CreateEmptyCompilation(useSource, 4890var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(Platform.AnyCpu), assemblyName: "PlatformMismatch"); 4903var useCompilation = CreateEmptyCompilation(useSource, 4909useCompilation = CreateEmptyCompilation(useSource, 4915useCompilation = CreateEmptyCompilation(useSource, 4921useCompilation = CreateEmptyCompilation(useSource, 4938var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(Platform.AnyCpu), assemblyName: "PlatformMismatch"); 4950var useCompilation = CreateEmptyCompilation(useSource, 4967var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(Platform.Itanium), assemblyName: "PlatformMismatch"); 4980var useCompilation = CreateEmptyCompilation(useSource, 4986useCompilation = CreateEmptyCompilation(useSource, 4992useCompilation = CreateEmptyCompilation(useSource, 4998useCompilation = CreateEmptyCompilation(useSource, 5015var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(Platform.Itanium), assemblyName: "PlatformMismatch"); 5028var useCompilation = CreateEmptyCompilation(useSource, 5038var comp = CreateEmptyCompilation("", new[] { TestReferences.SymbolsTests.netModule.x64COFF }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugDll);
Emit\CovariantReturnTests.cs (2)
226var compilation = CreateEmptyCompilation(new string[] { 244return CreateEmptyCompilation(
Emit\DeterministicTests.cs (4)
36var compilation = CreateEmptyCompilation(source, 55var compilation = CreateEmptyCompilation(source, assemblyName: "DeterminismTest", references: new[] { MscorlibRef, SystemCoreRef, CSharpRef }, options: options); 74var compilationDeterministic = CreateEmptyCompilation( 78var compilationNonDeterministic = CreateEmptyCompilation(
Emit\DynamicAnalysis\DynamicInstrumentationTests.cs (1)
2450ImmutableArray<Diagnostic> diagnostics = CreateEmptyCompilation(source + InstrumentationHelperSource).GetEmitDiagnostics(EmitOptions.Default.WithInstrumentationKinds(ImmutableArray.Create(InstrumentationKind.TestCoverage)));
Emit\EditAndContinue\AssemblyReferencesTests.cs (7)
66var c1 = CreateEmptyCompilation(src1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: references); 137var md1 = AssemblyMetadata.CreateFromStream(CreateEmptyCompilation(srcPE, parseOptions: parseOptions, references: new[] { MscorlibRef, SystemRef }).EmitToStream()); 139var c1 = CreateEmptyCompilation(src1, parseOptions: parseOptions, references: new[] { MscorlibRef }); 211var compilation0 = CreateEmptyCompilation(src0, new[] { MscorlibRef, lib0.ToMetadataReference() }, assemblyName: "C", options: TestOptions.DebugDll); 315var compilation0 = CreateEmptyCompilation(src0, new[] { MscorlibRef, lib0.ToMetadataReference() }, assemblyName: "C", options: TestOptions.DebugDll); 398var compilation0 = CreateEmptyCompilation(src0, new[] { MscorlibRef, lib0.EmitToImageReference() }, assemblyName: "C", options: TestOptions.DebugDll); 482var compilation0 = CreateEmptyCompilation(src0, new[] { MscorlibRef, ref01, ref11 }, assemblyName: "C", options: TestOptions.DebugDll);
Emit\EditAndContinue\EditAndContinueStateMachineTests.cs (8)
9953var compilation0 = CreateEmptyCompilation(new[] { source0.Tree }, new[] { TestReferences.NetFx.Minimal.mincorlib, TestReferences.NetFx.Minimal.minasync }, options: ComSafeDebugDll); 10013var compilation0 = CreateEmptyCompilation(new[] { source0.Tree }, new[] { TestReferences.NetFx.Minimal.mincorlib, TestReferences.NetFx.Minimal.minasync }, options: ComSafeDebugDll); 10078var compilation0 = CreateEmptyCompilation(new[] { source0.Tree }, new[] { TestReferences.NetFx.Minimal.mincorlib, TestReferences.NetFx.Minimal.minasync }, options: ComSafeDebugDll); 10128var compilation0 = CreateEmptyCompilation(new[] { source0.Tree }, new[] { Net451.mscorlib }, options: ComSafeDebugDll); 10179var compilation0 = CreateEmptyCompilation(new[] { source0.Tree }, new[] { TestReferences.NetFx.Minimal.mincorlib, TestReferences.NetFx.Minimal.minasync }, options: ComSafeDebugDll); 10230var compilation0 = CreateEmptyCompilation(new[] { source0.Tree }, new[] { Net20.mscorlib }, options: ComSafeDebugDll); 10291var compilation0 = CreateEmptyCompilation(new[] { source0.Tree }, new[] { Net20.mscorlib }, options: ComSafeDebugDll); 10346var compilation0 = CreateEmptyCompilation(new[] { source0.Tree }, new[] { Net451.mscorlib }, options: ComSafeDebugDll.WithMetadataImportOptions(MetadataImportOptions.All));
Emit\EditAndContinue\LocalSlotMappingTests.cs (2)
1024var compilation0 = CreateEmptyCompilation(source, options: TestOptions.DebugDll, references: new[] { MscorlibRef_v20 }); 1025var compilation1 = CreateEmptyCompilation(source, options: TestOptions.DebugDll, references: new[] { MscorlibRef_v20 });
Emit\InAttributeModifierTests.cs (11)
1505CreateEmptyCompilation(code).VerifyDiagnostics( 1526CreateEmptyCompilation(code).VerifyDiagnostics( 1547CreateEmptyCompilation(code).VerifyDiagnostics( 1567CreateEmptyCompilation(code).VerifyDiagnostics( 1588CreateEmptyCompilation(code).VerifyDiagnostics( 1609CreateEmptyCompilation(code).VerifyDiagnostics( 1630CreateEmptyCompilation(code).VerifyDiagnostics( 4450var corlibWithoutInAttributeRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 4458var ref1 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutInAttributeRef }).EmitToImageReference(); 4459var ref2 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutInAttributeRef }).EmitToImageReference(); 4467CreateEmptyCompilation(user, references: new[] { ref1, ref2, corlibWithoutInAttributeRef })
Emit\NoPiaEmbedTypes.cs (9)
798var piaCompilation = CreateEmptyCompilation(pia, new MetadataReference[] { MscorlibRef_v20 }, options: TestOptions.ReleaseDll); 821var compilation = CreateEmptyCompilation(consumer, new MetadataReference[] { MscorlibRef_v20, new CSharpCompilationReference(piaCompilation, embedInteropTypes: true) }, options: TestOptions.ReleaseExe); 825compilation = CreateEmptyCompilation(consumer, references: new MetadataReference[] { MscorlibRef_v20, piaCompilation.EmitToImageReference(embedInteropTypes: true) }, options: TestOptions.ReleaseExe); 847var piaCompilation = CreateEmptyCompilation(pia, new MetadataReference[] { MscorlibRef_v20 }, options: TestOptions.DebugDll); 871var compilation = CreateEmptyCompilation(consumer, new MetadataReference[] { MscorlibRef_v20, new CSharpCompilationReference(piaCompilation, embedInteropTypes: true) }, options: TestOptions.DebugExe); 875compilation = CreateEmptyCompilation(consumer, references: new MetadataReference[] { MscorlibRef_v20, piaCompilation.EmitToImageReference(embedInteropTypes: true) }, options: TestOptions.DebugExe); 1951var piaCompilation = CreateEmptyCompilation(pia, new MetadataReference[] { MscorlibRef_v4_0_30316_17626 }, options: TestOptions.DebugDll); 1999var compilation = CreateEmptyCompilation(consumer, 2007compilation = CreateEmptyCompilation(consumer,
PDB\PDBAsyncTests.cs (1)
2100var v = CreateEmptyCompilation(src, LatestVbReferences, options: TestOptions.DebugDll);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (115)
Attributes\AttributeTests.cs (1)
8181var comp2 = CreateEmptyCompilation(source3, assemblyName: "Temp2").ToMetadataReference();
Attributes\AttributeTests_Assembly.cs (6)
704compilation = CreateEmptyCompilation( 733compilation = CreateEmptyCompilation( 766compilation = CreateEmptyCompilation( 1175var netmoduleCompilation = CreateEmptyCompilation(netModuleSource, 1193var consoleappCompilation = CreateEmptyCompilation( 1234consoleappCompilation = CreateEmptyCompilation(
Attributes\AttributeTests_CallerInfoAttributes.cs (5)
72var compilation = CreateEmptyCompilation(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10); 138var compilation = CreateEmptyCompilation(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10); 203var compilation = CreateEmptyCompilation(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10); 318var compilation = CreateEmptyCompilation(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10); 375var compilation = CreateEmptyCompilation(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10);
Attributes\AttributeTests_Dynamic.cs (4)
1192var comp = CreateEmptyCompilation(source0, parseOptions: parseOptions); 1195comp = CreateEmptyCompilation(source1, references: new[] { ref0, SystemCoreRef }, parseOptions: parseOptions); 1229var comp = CreateEmptyCompilation(source0, parseOptions: parseOptions); 1232comp = CreateEmptyCompilation(source1, references: new[] { ref0, SystemCoreRef }, parseOptions: parseOptions);
Attributes\AttributeTests_Embedded.cs (4)
320CreateEmptyCompilation(code).VerifyEmitDiagnostics(CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("v4.0.30319"), 360CreateEmptyCompilation(code).VerifyEmitDiagnostics(CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("v4.0.30319"), 421CreateEmptyCompilation(code).VerifyEmitDiagnostics(CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("v4.0.30319"), 480CreateEmptyCompilation(code).VerifyEmitDiagnostics(CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("v4.0.30319"),
Attributes\AttributeTests_IsByRefLike.cs (1)
998var compilation1 = CreateEmptyCompilation(new[] { source1, compilerFeatureRequiredAttribute }, assemblyName: GetUniqueName());
Attributes\AttributeTests_MarshalAs.cs (2)
31var compilation = CreateEmptyCompilation(new SyntaxTree[0], new[] { assembly.GetReference() }, 63var compilation = CreateEmptyCompilation(
Attributes\AttributeTests_Nullable.cs (9)
30var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular8); 597var comp0 = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular7); 605var comp = CreateEmptyCompilation( 645var comp0 = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular7); 653var comp = CreateEmptyCompilation( 698var comp0 = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular7); 706var comp = CreateEmptyCompilation( 4393var comp0 = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 4412var comp = CreateEmptyCompilation(
Attributes\AttributeTests_Security.cs (1)
640var comp = CreateEmptyCompilation(source);
Attributes\AttributeTests_Synthesized.cs (7)
125var comp = CreateEmptyCompilation("", new[] { reference }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal)); 146var comp = CreateEmptyCompilation("", new[] { reference }, options: TestOptions.UnsafeReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal)); 1262var compilation = CreateEmptyCompilation("", parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: options); 1934var mslibComp = CreateEmptyCompilation(new string[] { mslib }, parseOptions: parseOptions).VerifyDiagnostics(); 1938var mslibNoStringComp = CreateEmptyCompilation(new string[] { mslibNoString }, parseOptions: parseOptions).VerifyDiagnostics(); 1955var diagLibComp = CreateEmptyCompilation(new string[] { diagLibSource }, parseOptions: parseOptions, references: new[] { mslibRef }).VerifyDiagnostics(); 1959var comp = CreateEmptyCompilation(new SyntaxTree[] { Parse("", options: parseOptions) }, references: new[] { diagLibRef, mslibNoStringRef });
Attributes\AttributeTests_Tuples.cs (4)
176var comp = CreateEmptyCompilation(source0, parseOptions: parseOptions); 179comp = CreateEmptyCompilation(source1, 214var comp = CreateEmptyCompilation(source0, parseOptions: parseOptions); 217comp = CreateEmptyCompilation(source1,
Attributes\AttributeTests_WellKnownAttributes.cs (11)
9691var compilation1 = CreateEmptyCompilation(source1, WinRtRefs, TestOptions.ReleaseDll); 9756var compilation2 = CreateEmptyCompilation(source2, WinRtRefs.Concat(new[] { new CSharpCompilationReference(compilation1) }), TestOptions.ReleaseDll); 9784compilation2 = CreateEmptyCompilation(source2, WinRtRefs.Concat(new[] { compilation1.EmitToImageReference() }), TestOptions.ReleaseDll); 9811var compilation = CreateEmptyCompilation(source, WinRtRefs, TestOptions.ReleaseDll); 10073var compilation1 = CreateEmptyCompilation(source1, WinRtRefs, TestOptions.ReleaseDll); 10110var compilation1 = CreateEmptyCompilation(source1, WinRtRefs, TestOptions.ReleaseDll); 10126var compilation2 = CreateEmptyCompilation(source2, WinRtRefs.Concat(new[] { new CSharpCompilationReference(compilation1) }), TestOptions.ReleaseDll); 10186var cscomp = CreateEmptyCompilation(cssource, new[] { MscorlibRef, ilReference }, TestOptions.ReleaseExe); 10294var cscomp = CreateEmptyCompilation(cssource, new[] { MscorlibRef, ilReference }, TestOptions.ReleaseExe); 13542CreateEmptyCompilation(code, references: WinRtRefs, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics( 13594CreateEmptyCompilation(code, references: WinRtRefs, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics(
Attributes\InternalsVisibleToAndStrongNameTests.cs (7)
2446var other = CreateEmptyCompilation( 2475var other = CreateEmptyCompilation( 2516var other = CreateEmptyCompilation(source, options: options, references: new[] { MscorlibRef_v4_0_30316_17626 }, parseOptions: parseOptions); 2534var other = CreateEmptyCompilation( 2566var other = CreateEmptyCompilation( 2591var other = CreateEmptyCompilation( 2621var other = CreateEmptyCompilation(
Diagnostics\GetDiagnosticsTests.cs (4)
324var compilation = CreateEmptyCompilation(string.Empty, parseOptions: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "1" })); 348var compilation = CreateEmptyCompilation(string.Empty, parseOptions: new CSharpParseOptions().WithLanguageVersion((LanguageVersion)10000)); 358var compilation = CreateEmptyCompilation(string.Empty, parseOptions: new CSharpParseOptions().WithDocumentationMode(unchecked((DocumentationMode)100))); 372var compilation = CreateEmptyCompilation(new[] { syntaxTree1, syntaxTree2, syntaxTree3 });
Emit\NumericIntPtrTests.cs (27)
123var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9); 173var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9); 233var comp = CreateEmptyCompilation(sourceA); 266comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 328var comp = CreateEmptyCompilation(sourceA, options: TestOptions.UnsafeReleaseDll); 365comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9, options: TestOptions.UnsafeReleaseDll); 429var comp = CreateEmptyCompilation(sourceA, options: TestOptions.UnsafeReleaseDll); 485comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9, options: TestOptions.UnsafeReleaseDll); 540var comp = CreateEmptyCompilation(sourceA); 560comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 625var comp = CreateEmptyCompilation(sourceA); 670comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 767var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular9); 809var comp = CreateEmptyCompilation(sourceA); 842comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 6863var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9); 10293var comp = CreateEmptyCompilation(new[] { source, corlib_cs }, parseOptions: parseOptions); 10296var corlib = CreateEmptyCompilation(corlib_cs, parseOptions: parseOptions); 10299comp = CreateEmptyCompilation(source, references: new[] { corlib.ToMetadataReference() }, parseOptions: parseOptions); 10302comp = CreateEmptyCompilation(source, references: new[] { corlib.EmitToImageReference() }, parseOptions: parseOptions); 10509var comp = CreateEmptyCompilation(new[] { source, corlib_cs }); 10634var comp = CreateEmptyCompilation(sourceA); 10647comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 10878var libComp = CreateEmptyCompilation(lib_cs, references: new[] { MscorlibRef_v20 }, assemblyName: "lib"); 10918var comp = CreateEmptyCompilation(source, references: new[] { libComp.ToMetadataReference(), MscorlibRef_v46 }); 11118var corlib = CreateEmptyCompilation(corlib_cs); 11119var comp = CreateEmptyCompilation(source, references: new[] { corlib.EmitToImageReference() });
Emit\UnmanagedTypeModifierTests.cs (12)
362CreateEmptyCompilation(code).VerifyDiagnostics( 383CreateEmptyCompilation(code).VerifyDiagnostics( 403CreateEmptyCompilation(code).VerifyDiagnostics( 435CreateEmptyCompilation(code).VerifyDiagnostics( 462CreateEmptyCompilation(code).VerifyDiagnostics( 490CreateEmptyCompilation(code).VerifyDiagnostics( 517CreateEmptyCompilation(code).VerifyDiagnostics( 553CreateEmptyCompilation(code).VerifyDiagnostics( 1079var corlibWithoutUnmanagedTypeRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 1087var ref1 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutUnmanagedTypeRef }).EmitToImageReference(); 1088var ref2 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutUnmanagedTypeRef }).EmitToImageReference(); 1095CreateEmptyCompilation(user, references: new[] { ref1, ref2, corlibWithoutUnmanagedTypeRef })
FlowAnalysis\RegionAnalysisTests.cs (4)
6311var compilation = CreateEmptyCompilation(source); 6350var compilation = CreateEmptyCompilation(source); 6377var compilation = CreateEmptyCompilation(source); 6415var compilation = CreateEmptyCompilation(source);
Semantics\PatternMatchingTests.cs (2)
3958var compilation = CreateEmptyCompilation(source, options: TestOptions.DebugExe, 5645var compilation = CreateEmptyCompilation(source);
Semantics\PatternMatchingTests5.cs (4)
2384var comp = CreateEmptyCompilation(new[] { source, INumberBaseBCL, INumberBaseDefinition }); 2414var comp = CreateEmptyCompilation(new[] { source, INumberBaseBCL, INumberBaseDefinition }); 2432var comp = CreateEmptyCompilation(new[] { source, INumberBaseBCL, INumberBaseDefinition }); 2469var comp = CreateEmptyCompilation(new[] { source, INumberBaseBCL, INumberBaseDefinition });
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.UnitTests (25)
LocalsTests.cs (1)
3850var comp = CreateEmptyCompilation(new[] { source, AsyncStreamsTypes }, references: references);
MissingAssemblyTests.cs (4)
39var assembly = CreateEmptyCompilation("").Assembly; 558var comp = CreateEmptyCompilation(source, WinRtRefs, TestOptions.DebugDll); 601var comp = CreateEmptyCompilation(source, WinRtRefs, TestOptions.DebugDll); 736var compilation = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef });
ReferencedModulesTests.cs (7)
990var moduleA = CreateEmptyCompilation( 995var moduleB = CreateEmptyCompilation( 1090var compilation = CreateEmptyCompilation( 1106compilation = CreateEmptyCompilation( 1280var compCorLib = CreateEmptyCompilation(sourceCorLib, assemblyName: CorLibAssemblyName, references: new[] { MscorlibRef, refLib }, parseOptions: parseOptions); 1316var comp = CreateEmptyCompilation(source, options: TestOptions.DebugDll, references: new[] { refLib, AssemblyMetadata.Create(module).GetReference() }, parseOptions: parseOptions); 1398var compCorLib = CreateEmptyCompilation(sourceCorLib, assemblyName: CorLibAssemblyName, references: new[] { MscorlibRef, refLib }, options: options);
TupleTests.cs (3)
106var corlibWithoutVT = CreateEmptyCompilation(new[] { Parse(String.Format(versionTemplate, "1") + corlib_cs, options: parseOptions) }, assemblyName: "corlib"); 110var corlibWithVT = CreateEmptyCompilation(new[] { Parse(String.Format(versionTemplate, "2") + corlib_cs + valuetuple_cs, options: parseOptions) }, assemblyName: "corlib"); 123var app = CreateEmptyCompilation(source + valuetuple_cs, references: new[] { corlibWithoutVTRef }, parseOptions: parseOptions, options: TestOptions.DebugDll);
UsingDebugInfoTests.cs (4)
234var aliasedRef = CreateEmptyCompilation("", assemblyName: "Lib", parseOptions: parseOptions).EmitToImageReference(aliases: ImmutableArray.Create("A")); 336var aliasedRef = CreateEmptyCompilation("", assemblyName: "Lib", parseOptions: parseOptions).EmitToImageReference(aliases: ImmutableArray.Create("A")); 1227var comp1 = CreateEmptyCompilation(source1, new[] { MscorlibRef_v20 }, TestOptions.DebugDll); 1230var comp2 = CreateEmptyCompilation(source2, new[] { MscorlibRef_v4_0_30316_17626, module1.GetReference() }, TestOptions.DebugDll);
WinMdTests.cs (6)
44var compilation0 = CreateEmptyCompilation( 86var compilation0 = CreateEmptyCompilation( 179var compilation0 = CreateEmptyCompilation(source, compileReferences, TestOptions.DebugDll); 258var compilation = CreateEmptyCompilation(source, WinRtRefs, TestOptions.DebugDll); 307var compilation = CreateEmptyCompilation(source, WinRtRefs, TestOptions.DebugDll); 341var compilation = CreateEmptyCompilation(source, WinRtRefs, TestOptions.DebugDll);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (16)
IOperation\IOperationTests_IArgument.cs (8)
2456var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 2520var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 2605var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 2661var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 2719var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 2801var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 3852var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 3944var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll);
IOperation\IOperationTests_IConstructorBodyOperation.cs (1)
1118var compilation = CreateEmptyCompilation(source);
IOperation\IOperationTests_IParameterReferenceExpression.cs (1)
985var compilation1 = CreateEmptyCompilation(
IOperation\IOperationTests_IVariableDeclaration.cs (6)
610var compilation = CreateEmptyCompilation(source); 632var compilation = CreateEmptyCompilation(source); 653var compilation = CreateEmptyCompilation(source); 674var compilation = CreateEmptyCompilation(source); 848var compilation = CreateEmptyCompilation(source); 870var compilation = CreateEmptyCompilation(source);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (225)
Semantics\AccessCheckTests.cs (1)
963c = CreateEmptyCompilation(source, TargetFrameworkUtil.GetReferences(TargetFramework.Standard).AddRange(new[] { r1, r2 }));
Semantics\AccessibilityTests.cs (1)
33CSharpCompilation c = CreateEmptyCompilation(new[] { t });
Semantics\BindingAsyncTasklikeMoreTests.cs (2)
1259var compilation0 = CreateEmptyCompilation(source0, references: new[] { MscorlibRef_v20 }); 1275var compilation = CreateEmptyCompilation(source, references: new[] { MscorlibRef_v20, ref0 });
Semantics\ColorColorTests.cs (4)
2081var refLib = CreateEmptyCompilation( 2099var main = CreateEmptyCompilation( 2126var refLib = CreateEmptyCompilation( 2144var main = CreateEmptyCompilation(sourceMain, assemblyName: "Main",
Semantics\DelegateTypeTests.cs (14)
2291var comp = CreateEmptyCompilation(sourceB, new[] { refA }, parseOptions: TestOptions.RegularPreview); 2392var comp = CreateEmptyCompilation(sourceB, new[] { refA }, parseOptions: TestOptions.RegularPreview); 2466var comp = CreateEmptyCompilation(sourceB, new[] { refA }, parseOptions: TestOptions.RegularPreview); 2557var comp = CreateEmptyCompilation(sourceB, new[] { refA }, parseOptions: TestOptions.RegularPreview); 2642var comp = CreateEmptyCompilation(sourceB, new[] { refA }); 2664var comp = CreateEmptyCompilation(sourceB, new[] { refA }); 2711var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }); 2763var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }); 2801var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 2837var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseExe); 2873var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 2906var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 7923var comp = CreateEmptyCompilation(source, new[] { GetCorlibWithInvalidActionAndFuncOfT() }); 15145CreateEmptyCompilation(source).VerifyDiagnostics(
Semantics\ForEachTests.cs (23)
1956var compilation = CreateEmptyCompilation(text); 1976var compilation = CreateEmptyCompilation(text); 1995var compilation = CreateEmptyCompilation(text); 2122var comp = CreateEmptyCompilation(source, new[] { MscorlibRefPortable }); 2230var comp = CreateEmptyCompilation(text); 2282var comp = CreateEmptyCompilation(text); 2348var comp = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular7_3, skipUsesIsNullable: true); 2351comp = CreateEmptyCompilation(text, skipUsesIsNullable: true); 2389var comp = CreateEmptyCompilation(text); 2451var comp = CreateEmptyCompilation(text); 2521var comp = CreateEmptyCompilation(text); 2591var comp = CreateEmptyCompilation(text); 2636var comp = CreateEmptyCompilation(text); 2701var comp = CreateEmptyCompilation(text); 2764var comp = CreateEmptyCompilation(text); 2827var comp = CreateEmptyCompilation(text); 2880var comp = CreateEmptyCompilation(source); // Lots of errors, since corlib is missing. 3069var compilation1 = CreateEmptyCompilation(source1, assemblyName: GetUniqueName()); 3083var comp = CreateEmptyCompilation(text, new[] { reference1 }); 3383var comp1 = CreateEmptyCompilation(source1, options: TestOptions.DebugDll, assemblyName: "MissingBaseType1"); 3411var comp2 = CreateEmptyCompilation(source2, new[] { comp1.ToMetadataReference() }, options: TestOptions.DebugDll); 3426var comp3 = CreateEmptyCompilation(source3, options: TestOptions.DebugDll, assemblyName: "MissingBaseType2"); 3439var comp4 = CreateEmptyCompilation(source4, new[] { comp2.ToMetadataReference(), comp3.ToMetadataReference() });
Semantics\GenericConstraintsTests.cs (5)
641CreateEmptyCompilation(@" 1154CreateEmptyCompilation(@" 1639CreateEmptyCompilation(@" 1934CreateEmptyCompilation(@" 1952CreateEmptyCompilation(@"
Semantics\IndexAndRangeTests.cs (4)
613var comp = CreateEmptyCompilation(@" 844var compilation = CreateEmptyCompilation(@" 1148var compilation = CreateEmptyCompilation(@" 1190var compilation = CreateEmptyCompilation(@"
Semantics\InitOnlyMemberTests.cs (17)
4640var corlibWithoutIsExternalInitRef = CreateEmptyCompilation(corlib_cs, assemblyName: "corlibWithoutIsExternalInit") 4643var corlibWithIsExternalInitRef = CreateEmptyCompilation(corlib_cs + IsExternalInitTypeDefinition, assemblyName: "corlibWithIsExternalInit") 4646var libWithIsExternalInitRef = CreateEmptyCompilation(IsExternalInitTypeDefinition, references: new[] { corlibWithoutIsExternalInitRef }, assemblyName: "libWithIsExternalInit") 4649var libWithIsExternalInitRef2 = CreateEmptyCompilation(IsExternalInitTypeDefinition, references: new[] { corlibWithoutIsExternalInitRef }, assemblyName: "libWithIsExternalInit2") 4654var comp = CreateEmptyCompilation(new[] { source, IsExternalInitTypeDefinition }, references: new[] { corlibWithoutIsExternalInitRef }, assemblyName: "source"); 4661var comp = CreateEmptyCompilation(new[] { source }, references: new[] { corlibWithoutIsExternalInitRef, libWithIsExternalInitRef }, assemblyName: "source"); 4668var comp = CreateEmptyCompilation(new[] { source, IsExternalInitTypeDefinition }, references: new[] { corlibWithIsExternalInitRef }, assemblyName: "source"); 4675var comp = CreateEmptyCompilation(new[] { source, IsExternalInitTypeDefinition }, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef }, assemblyName: "source"); 4682var comp = CreateEmptyCompilation(source, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef, libWithIsExternalInitRef2 }); 4689var comp = CreateEmptyCompilation(source, references: new[] { libWithIsExternalInitRef, corlibWithIsExternalInitRef, libWithIsExternalInitRef2 }); 4696var comp = CreateEmptyCompilation(source, references: new[] { libWithIsExternalInitRef, libWithIsExternalInitRef2, corlibWithIsExternalInitRef }); 4703var comp = CreateEmptyCompilation(source, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef, libWithIsExternalInitRef2 }, 4714var comp = CreateEmptyCompilation(source, references: new[] { corlibWithoutIsExternalInitRef, libWithIsExternalInitRef, libWithIsExternalInitRef2 }); 4724var comp = CreateEmptyCompilation(source, references: new[] { corlibWithoutIsExternalInitRef, libWithIsExternalInitRef, libWithIsExternalInitRef2 }, 4735var comp = CreateEmptyCompilation(source, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef }); 4742var comp = CreateEmptyCompilation(source, references: new[] { libWithIsExternalInitRef, corlibWithIsExternalInitRef }); 4749var comp = CreateEmptyCompilation(source, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef },
Semantics\InterpolationTests.cs (3)
1037CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugExe) 1070CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugExe) 1115var comp = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: Test.Utilities.TestOptions.UnsafeReleaseDll).VerifyDiagnostics();
Semantics\NativeIntegerTests.cs (50)
175var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 181comp = CreateEmptyCompilation(sourceA, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 188comp = CreateEmptyCompilation(sourceB, references: new[] { ref1 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 194comp = CreateEmptyCompilation(sourceB, references: new[] { ref2 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 695var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 699comp = CreateEmptyCompilation(sourceA, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 704comp = CreateEmptyCompilation(sourceB, references: new[] { ref1 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 708comp = CreateEmptyCompilation(sourceB, references: new[] { ref2 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 856comp = CreateEmptyCompilation(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9); 895comp = CreateEmptyCompilation(sourceB, references: new[] { ref2, refA }, parseOptions: TestOptions.Regular9); 965comp = CreateEmptyCompilation(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9); 1012comp = CreateEmptyCompilation(sourceB, references: new[] { ref2, refA }, parseOptions: TestOptions.Regular9); 1149comp = CreateEmptyCompilation(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9); 1161comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 1224comp = CreateEmptyCompilation(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9); 1236comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 1293var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9); 1447var comp = CreateEmptyCompilation( 1473comp = CreateEmptyCompilation( 1506var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: parseOptions); 1510comp = CreateEmptyCompilation(sourceA, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 1515comp = CreateEmptyCompilation(sourceB, references: new[] { ref1 }, parseOptions: parseOptions); 1519comp = CreateEmptyCompilation(sourceB, references: new[] { ref2 }, parseOptions: parseOptions); 1532var comp = CreateEmptyCompilation(sourceB, references: new[] { reference }, parseOptions: parseOptions); 1590var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular9); 1597comp = CreateEmptyCompilation("", references: new[] { ref1 }, parseOptions: TestOptions.Regular9); 1601comp = CreateEmptyCompilation("", references: new[] { ref2 }, parseOptions: TestOptions.Regular9); 1643var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular9); 1650comp = CreateEmptyCompilation("", references: new[] { ref1 }, parseOptions: TestOptions.Regular9); 1654comp = CreateEmptyCompilation("", references: new[] { ref2 }, parseOptions: TestOptions.Regular9); 1725var comp = CreateEmptyCompilation(sourceA); 1757comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 1893var comp = CreateEmptyCompilation(sourceA, options: TestOptions.UnsafeReleaseDll); 1930comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9, options: TestOptions.UnsafeReleaseDll); 2056var comp = CreateEmptyCompilation(sourceA, options: TestOptions.UnsafeReleaseDll); 2112comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9, options: TestOptions.UnsafeReleaseDll); 2206var comp = CreateEmptyCompilation(sourceA); 2226comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 2298var comp = CreateEmptyCompilation(sourceA); 2329comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 2461var compB = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 2545var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular9); 2597var comp = CreateEmptyCompilation(sourceA); 2617comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 2701var comp = CreateEmptyCompilation(sourceA); 2719comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 2871var comp = CreateEmptyCompilation(sourceB, new[] { refA }, parseOptions: TestOptions.Regular9); 4573var comp = CreateEmptyCompilation(sourceA); 4590comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 10350var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9);
Semantics\NullableReferenceTypesTests.cs (18)
8693var comp0 = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular7); 8703var comp = CreateEmptyCompilation( 8742var comp = CreateEmptyCompilation(new[] { source, source2 }); 8755var comp2 = CreateEmptyCompilation(new[] { source, source3 }); 8768var comp3 = CreateEmptyCompilation(new[] { source, source4 }); 79413var comp = CreateEmptyCompilation(new[] { source }, options: WithNullableEnable()); 85193var comp = CreateEmptyCompilation(source); 85203var comp2 = CreateEmptyCompilation(new[] { source }, options: WithNullableEnable()); 86407var comp = CreateEmptyCompilation(new[] { source }, options: WithNullableEnable()); 87755var comp = CreateEmptyCompilation(new[] { source, systemSource }, options: WithNullableEnable()); 111966var comp = CreateEmptyCompilation(new[] { source0 }, options: WithNullableEnable()); 112888var compilation1 = CreateEmptyCompilation(source1, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { MinCorlibRef }); 112904var compilation2 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.EmitToImageReference(), MinCorlibRef }); 112917var compilation3 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.ToMetadataReference(), MinCorlibRef }); 112928var compilation4 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.EmitToImageReference() }); 112958var compilation5 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.ToMetadataReference() }); 112996var compilation6 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.EmitToImageReference(), MscorlibRef }); 113026var compilation7 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.ToMetadataReference(), MscorlibRef });
Semantics\OverloadResolutionTestBase.cs (1)
32var compilation = CreateEmptyCompilation(source, references, TestOptions.ReleaseDll);
Semantics\OverloadResolutionTests.cs (1)
1120var compilation = CreateEmptyCompilation(source, references: new[] { MscorlibRef_v20 });
Semantics\PropertyAccessTests.cs (1)
33var comp = CreateEmptyCompilation(
Semantics\RawInterpolationTests.cs (3)
1035CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugExe) 1067CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugExe) 1111var comp = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: Test.Utilities.TestOptions.UnsafeReleaseDll).VerifyDiagnostics();
Semantics\RecordStructTests.cs (7)
2285var corlibRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 2297var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef }); 2321var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef }); 2387var corlibRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 2397var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef }); 4481var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute()); 4758var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute());
Semantics\RecordTests.cs (17)
16283var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 16292comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 17232var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 17242comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 17328var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 17338comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 17424var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 17433comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 24285var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 24293comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 24350var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 24358comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 24420var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 24429comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 24499var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 24513comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 30142var compA = CreateEmptyCompilation(new[] { sourceA, IsExternalInitTypeDefinition }, references: TargetFrameworkUtil.GetReferences(TargetFramework.NetStandard20));
Semantics\RefFieldTests.cs (12)
2143var comp = CreateEmptyCompilation(new[] { sourceA }, parseOptions: TestOptions.Regular10); 2146comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular10); 2163comp = CreateEmptyCompilation(source, references: new[] { refA }, parseOptions: TestOptions.Regular10); 2177comp = CreateEmptyCompilation(source, references: new[] { refAB }, parseOptions: TestOptions.Regular10); 2185comp = CreateEmptyCompilation(source, references: new[] { refA }); 2193comp = CreateEmptyCompilation(source, references: new[] { refAB }); 25844comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 25853comp = CreateEmptyCompilation(source2, references: new[] { ref0, ref1 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 25905comp = CreateEmptyCompilation(source1, references: new[] { refLowerVersion }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 25920comp = CreateEmptyCompilation(source2, references: new[] { refHigherVersion, ref1 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 25969comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular10); 25984comp = CreateEmptyCompilation(source2, references: new[] { ref0, ref1 });
Semantics\ScriptSemanticsTests.cs (8)
87var taskCompilation = CreateEmptyCompilation(taskAssembly, references: new[] { MscorlibRef_v20 }); 97var script = CreateEmptyCompilation( 114var script = CreateEmptyCompilation( 139var script = CreateEmptyCompilation( 159var script = CreateEmptyCompilation( 185var script = CreateEmptyCompilation( 204var script = CreateEmptyCompilation( 1371var script = CreateEmptyCompilation(
Semantics\SemanticErrorTests.cs (2)
11129CreateEmptyCompilation(text).VerifyDiagnostics( 21848CreateEmptyCompilation(text).
Semantics\SpanStackSafetyTests.cs (8)
1435var reference = CreateEmptyCompilation( 1452var comp = CreateEmptyCompilation( 1469var reference = CreateEmptyCompilation( 1486var comp = CreateEmptyCompilation( 1513var reference = CreateEmptyCompilation( 1530var comp = CreateEmptyCompilation( 1554var reference = CreateEmptyCompilation( 1571var comp = CreateEmptyCompilation(
Semantics\StackAllocSpanExpressionsTests.cs (1)
781CreateEmptyCompilation(code, references, TestOptions.UnsafeReleaseDll).VerifyDiagnostics(
Semantics\SwitchTests.cs (1)
1152var comp = CreateEmptyCompilation(new[] { syntaxTree }, references: null);
Semantics\TopLevelStatementsTests.cs (1)
7431var comp = CreateEmptyCompilation(text, options: TestOptions.DebugExe, parseOptions: DefaultParseOptions);
Semantics\UnsafeTests.cs (1)
58var comp1 = CreateEmptyCompilation(text1, assemblyName: "assembly1", references: new[] { MscorlibRef_v20 },
Semantics\UserDefinedConversionTests.cs (5)
1601CreateEmptyCompilation(source).VerifyDiagnostics(); 1673var comp = CreateEmptyCompilation(code); 1718var comp = CreateEmptyCompilation(code); 1771var comp = CreateEmptyCompilation(code); 1828var comp = CreateEmptyCompilation(code);
Semantics\UseSiteErrorTests.cs (11)
1034var lib1 = CreateEmptyCompilation( 1048var lib2 = CreateEmptyCompilation( 1213var compilation = CreateEmptyCompilation(text).VerifyDiagnostics( 2256var compilation = CreateEmptyCompilation( 2296var compilation1 = CreateEmptyCompilation(source1, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { MinCorlibRef }); 2312var compilation2 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference(), MinCorlibRef }); 2323var compilation3 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.ToMetadataReference(), MinCorlibRef }); 2334var compilation4 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference() }); 2364var compilation5 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.ToMetadataReference() }); 2379var compilation6 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference(), MscorlibRef }); 2409var compilation7 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.ToMetadataReference(), MscorlibRef });
Semantics\UsingStatementTests.cs (2)
1773CreateEmptyCompilation(source).VerifyDiagnostics( 1799CreateEmptyCompilation(source).VerifyDiagnostics(
SourceGeneration\GeneratorDriverTests.cs (1)
2905Compilation compilation = CreateEmptyCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions, references: metadataRefs);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (298)
BadSymbolReference.cs (6)
749var compilation1 = CreateEmptyCompilation( 796var libRef = CreateEmptyCompilation(libSource, new[] { MscorlibRef }, assemblyName: "System.Drawing").EmitToImageReference(); 798var comp1 = CreateEmptyCompilation(project1Source, new[] { MscorlibRef, libRef }, assemblyName: "Project1"); 801var comp2 = CreateEmptyCompilation(project2Source, new[] { MscorlibRef, libRef }, assemblyName: "Project2"); 806var comp3 = CreateEmptyCompilation(project3Source, new[] { MscorlibRef, comp1.ToMetadataReference(), comp2.ToMetadataReference() }, assemblyName: "Project3"); 815var comp3 = CreateEmptyCompilation(project3Source, new[] { MscorlibRef, comp1.EmitToImageReference(), comp2.EmitToImageReference() }, assemblyName: "Project3");
Compilation\CompilationAPITests.cs (15)
1903var comp = CreateEmptyCompilation(text, references: new[] { MscorlibRef, alias }); 2207var c1 = CreateEmptyCompilation("public class Main { public static C C; }", new[] { MscorlibRef, reference, reference }); 2256var compilation = CreateEmptyCompilation( 2277compilation = CreateEmptyCompilation( 2292var libComp = CreateEmptyCompilation( 2313var c1 = CreateEmptyCompilation( 2338var c2 = CreateEmptyCompilation( 3600var corlib = CreateEmptyCompilation(corlibSource, parseOptions: parseOptions); 3603var other = CreateEmptyCompilation(@"public class C {}", new[] { corlibReference }, parseOptions: parseOptions); 3606var current = CreateEmptyCompilation(@"public class C {}", new[] { otherReference, corlibReference }); 3635var corlib = CreateEmptyCompilation(corlibSource, parseOptions: parseOptions); 3638var current = CreateEmptyCompilation(@"", new[] { corlibReference }, parseOptions: parseOptions); 3660var corlib = CreateEmptyCompilation(corlibSource, parseOptions: parseOptions); 3663var other = CreateEmptyCompilation(@"public class C {}", new[] { corlibReference }, parseOptions: parseOptions); 3666var current = CreateEmptyCompilation(@"", new[] { otherReference, corlibReference });
Compilation\GetSemanticInfoBrokenCodeTests.cs (3)
315var comp = CreateEmptyCompilation(new[] { tree }); 330var comp = CreateEmptyCompilation(new[] { tree }); 345var comp = CreateEmptyCompilation(new[] { tree });
Compilation\GetUnusedImportDirectivesTests.cs (2)
122var comp = CreateEmptyCompilation(text, new[] { MscorlibRef }); 346var lib = CreateEmptyCompilation("", assemblyName: "lib");
Compilation\ReferenceManagerTests.cs (83)
516var libV1 = CreateEmptyCompilation( 540var libV2 = CreateEmptyCompilation( 556var refLibV1 = CreateEmptyCompilation( 570var main = CreateEmptyCompilation( 745var compilation = CreateEmptyCompilation(tree, new[] { MscorlibRef, r1, r2_SysCore }, TestOptions.DebugExe, assemblyName: "Test"); 832return CreateEmptyCompilation(s, references); 962var c = CreateEmptyCompilation("class C {}", TargetFrameworkUtil.StandardReferences.AddRange(new[] { ref1, ref2 })); 984var c = CreateEmptyCompilation("class C {}", TargetFrameworkUtil.StandardReferences.AddRange(new[] { ref1, ref2 })); 1056CreateEmptyCompilation(source, TargetFrameworkUtil.StandardReferences.AddRange(new[] { ref1, ref2 })).VerifyDiagnostics(); 1132var main = CreateEmptyCompilation(sourceMain, 1197var main = CreateEmptyCompilation(sourceMain, 1225var compilation = CreateEmptyCompilation(source, TargetFrameworkUtil.StandardReferences.AddRange(new[] { arSA, enUS })); 1888var pl = CreateEmptyCompilation(plSource, new[] { MscorlibPP7Ref, SystemRuntimePP7Ref }); 1894var main = CreateEmptyCompilation(mainSource, new MetadataReference[] { r1, MscorlibFacadeRef }, options: TestOptions.ReleaseDll); 1900main = CreateEmptyCompilation(mainSource, new MetadataReference[] { r1, MscorlibFacadeRef, SystemRuntimeFacadeRef }); 2151var corlib1 = CreateEmptyCompilation(""); 2183var c1 = CreateEmptyCompilation("", 2193var c2 = CreateEmptyCompilation("", 2248CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").EmitToImageReference(), 2249CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2266CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""0.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2267CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.1"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2268CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2269CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2270CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.1.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(). 2393var c = CreateEmptyCompilation(source, new[] 2429var c = CreateEmptyCompilation(source, new[] 2465var c = CreateEmptyCompilation(source, new[] 2506var c = CreateEmptyCompilation(source, new[] 2577var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2578var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2579var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public class B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2581var aRef = CreateEmptyCompilation("public class A : B { }", new[] { MscorlibRef, b1Ref }, assemblyName: "A").EmitToImageReference(); 2582var dRef = CreateEmptyCompilation("public class D : B { }", new[] { MscorlibRef, b2Ref }, assemblyName: "D").EmitToImageReference(); 2593var c = CreateEmptyCompilation(@" 2631var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2632var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2633var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2634var b4Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2636var aRef = CreateEmptyCompilation(@"public interface A : B { }", new[] { MscorlibRef, b1Ref }, assemblyName: "A").EmitToImageReference(); 2637var dRef = CreateEmptyCompilation(@"public interface D : B { }", new[] { MscorlibRef, b2Ref }, assemblyName: "D").EmitToImageReference(); 2667var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2668var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2669var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2670var b4Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2672var aRef = CreateEmptyCompilation(@"public interface A : B { }", new[] { MscorlibRef, b1Ref }, assemblyName: "A").EmitToImageReference(); 2673var dRef = CreateEmptyCompilation(@"public interface D : B { }", new[] { MscorlibRef, b2Ref }, assemblyName: "D").EmitToImageReference(); 2873var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2874var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2876var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference(); 2877var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference(); 2885var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef }, 2896var c = CreateEmptyCompilation("public class C : A { }", new[] { MscorlibRef, aRef, b1Ref }, 2939var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", references: new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2940var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", references: new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2942var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference(); 2943var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference(); 2951var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef }, 2962var c = CreateEmptyCompilation("public class C : A { }", new[] { MscorlibRef, aRef, b2Ref }, 2999var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3000var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3002var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference(); 3003var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference(); 3005var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef, b1Ref, b2Ref }, 3043var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3044var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3045var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3046var b4Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3048var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference(); 3049var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference(); 3051var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef, b1Ref, b2Ref }, 3062var c = CreateEmptyCompilation("public class C : A { }", new[] { MscorlibRef, aRef }, 3109var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3110var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3111var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3112var b4Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3114var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference(); 3115var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference(); 3117var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef, b1Ref, b2Ref }, 3178var aRef = CreateEmptyCompilation(@"public interface A { System.Diagnostics.Process PA { get; } }", new[] { Net20.mscorlib, Net20.System }, 3181var bRef = CreateEmptyCompilation(@"public interface B { System.Diagnostics.Process PB { get; } }", new[] { MscorlibRef_v4_0_30316_17626, Net451.System }, 3218var aRef = CreateEmptyCompilation(@"public interface A { C CA { get; } }", new[] { MscorlibRef, TestReferences.SymbolsTests.Versioning.C2 }, 3221var bRef = CreateEmptyCompilation(@"public interface B { C CB { get; } }", new[] { MscorlibRef, TestReferences.SymbolsTests.Versioning.C1 },
Compilation\SemanticModelAPITests.cs (2)
2367var compilation = CreateEmptyCompilation(@" 2380var compilation = CreateEmptyCompilation(@"
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
3720var compilation = (Compilation)CreateEmptyCompilation(new string[] {
Compilation\UsedAssembliesTests.cs (12)
35var comp1 = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 56var comp1 = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 297Compilation comp = CreateEmptyCompilation(source, 379var comp1 = CreateEmptyCompilation(source, parseOptions: parseOptions); 403Compilation comp2 = CreateEmptyCompilation(source2, references: new[] { reference, SystemCoreRef, SystemDrawingRef }, parseOptions: parseOptions); 420var comp1 = CreateEmptyCompilation(source, parseOptions: parseOptions); 437Compilation comp2 = CreateEmptyCompilation(source2, references: new[] { reference, SystemCoreRef, SystemDrawingRef }, parseOptions: parseOptions); 5362var comp0 = CreateEmptyCompilation(source0, parseOptions: parseOptions); 5378var comp1 = CreateEmptyCompilation(source1, references: new[] { comp0Ref }, parseOptions: parseOptions); 5389var comp2 = CreateEmptyCompilation(source2, references: new[] { comp0Ref }, parseOptions: parseOptions); 5405var comp3 = CreateEmptyCompilation(source3, references: references, parseOptions: parseOptions); 5420var comp4 = CreateEmptyCompilation(source4, references: new[] { comp0Ref, comp1Ref, comp2Ref }, parseOptions: parseOptions);
CrossLanguageTests.cs (1)
35var comp = CreateEmptyCompilation(new[] { tree }, new[] { ref1 });
DocumentationComments\CrefTests.cs (1)
5872var comp = CreateEmptyCompilation(
DocumentationComments\MethodDocumentationCommentTests.cs (3)
237var compilation = CreateEmptyCompilation(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Diagnose)); 242compilation = CreateEmptyCompilation(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)); 247compilation = CreateEmptyCompilation(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.None));
SymbolDisplay\SymbolDisplayTests.cs (2)
4570var comp = CreateEmptyCompilation(source, WinRtRefs, TestOptions.ReleaseWinMD); 5351var compA = CreateEmptyCompilation(sourceA, new[] { MscorlibRef });
Symbols\AnonymousTypesSymbolTests.cs (4)
1757var comp = CreateEmptyCompilation(new[] { Parse(source), s_equalityComparerSourceTree }, new[] { MinCorlibRef }); 1785var stateLib = CreateEmptyCompilation(stateSource, new[] { MinCorlibRef }); 1799var attributeLib = CreateEmptyCompilation(attributeSource, new[] { MinCorlibRef, stateLib.ToMetadataReference() }); 1811var comp = CreateEmptyCompilation(new[] { Parse(source), s_equalityComparerSourceTree }, new[] { MinCorlibRef, attributeLib.ToMetadataReference() });
Symbols\ArrayTypeSymbolTests.cs (1)
26var c = CreateEmptyCompilation(@"
Symbols\AssemblyAndNamespaceTests.cs (4)
208var comp = CreateEmptyCompilation(new string[] { text3 }, references: new MetadataReference[] { compRef1, compRef2 }.ToList(), assemblyName: "Test3"); 313var compilation = CreateEmptyCompilation(@" 344var compilation = CreateEmptyCompilation(@" 375var comp = CreateEmptyCompilation(source, new[] { aliasedCorlib });
Symbols\CompilationCreationTests.cs (1)
2548var c1 = CreateEmptyCompilation(text, new MetadataReference[]
Symbols\CorLibrary\Choosing.cs (4)
31var corLib = CreateEmptyCompilation(@" 45var consumer = CreateEmptyCompilation(@" 57var corLib = CreateEmptyCompilation(@" 66var consumer = CreateEmptyCompilation(@"
Symbols\CorLibrary\CorTypes.cs (1)
219CreateEmptyCompilation(source1 + source2).VerifyDiagnostics();
Symbols\CovariantReturnTests.cs (5)
218CorelibraryWithoutCovariantReturnSupport1 = CreateEmptyCompilation(new string[] { 222CorelibraryWithoutCovariantReturnSupport2 = CreateEmptyCompilation(new string[] { 226CorelibraryWithCovariantReturnSupport1 = CreateEmptyCompilation(new string[] { 230CorelibraryWithCovariantReturnSupport2 = CreateEmptyCompilation(new string[] { 234CorelibraryWithCovariantReturnSupportButWithoutPreserveBaseOverridesAttribute = CreateEmptyCompilation(new string[] {
Symbols\DefaultInterfaceImplementationTests.cs (2)
67676var compilation1 = CreateEmptyCompilation(source1, options: TestOptions.DebugDll, 67707var compilation1 = CreateEmptyCompilation(source1, options: TestOptions.DebugDll,
Symbols\ExtensionMethodTests.cs (2)
2210var compilation = CreateEmptyCompilation(source, new[] { Net40.mscorlib }); 3453var compilation = CreateEmptyCompilation(source, new[] { MscorlibRef_v20 }, TestOptions.ReleaseDll);
Symbols\FunctionPointerTypeSymbolTests.cs (2)
1943var otherCorLib = CreateEmptyCompilation(@" 2069var comp = CreateEmptyCompilation(@"
Symbols\GenericConstraintTests.cs (3)
5741CreateEmptyCompilation(source).VerifyDiagnostics( 5769CreateEmptyCompilation(source).VerifyDiagnostics( 7297var metadataComp = CreateEmptyCompilation(code, new[] { MscorlibRef_v20 }, assemblyName: "assembly1");
Symbols\ImplicitClassTests.cs (1)
22var c = CreateEmptyCompilation(@"
Symbols\IndexerTests.cs (1)
2832var comp1 = CreateEmptyCompilation(src1, new[] { TestMetadata.Net40.mscorlib });
Symbols\Metadata\MetadataMemberTests.cs (2)
186var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef }); 238var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef });
Symbols\Metadata\MetadataTypeTests.cs (6)
26var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef }); 66var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef }); 116var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal)); 214var compilation = CreateEmptyCompilation(text, 278var compilation1 = CreateEmptyCompilation(source1, new[] { TestMetadata.Net40.mscorlib, TestMetadata.Net40.SystemCore }); 282var compilation2 = CreateEmptyCompilation(source2, new MetadataReference[] { TestMetadata.Net40.mscorlib, TestMetadata.Net40.SystemCore, compilation1.EmitToImageReference() },
Symbols\Metadata\PE\LoadingMethods.cs (1)
1348var comp = CreateEmptyCompilation("", new[] { ilRef });
Symbols\Metadata\PE\NoPiaLocalHideAndTypeSubstitutionTests.cs (11)
73var localType1 = CreateEmptyCompilation(assemblyName: "Dummy1", source: new string[] { localTypeSource1 }, 79var localType2 = CreateEmptyCompilation(assemblyName: "Dummy2", source: new string[] { localTypeSource2 }, 86var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy3", source: CSharpTestSource.None, 122var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: new string[] { localTypeSource }, 185var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: new string[] { localTypeSource }, 222var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: new string[] { localTypeSource }, 257var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: new string[] { localTypeSource }, 288var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: new string[] { localTypeSource }, 316var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: CSharpTestSource.None, 338var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: CSharpTestSource.None, 360var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: CSharpTestSource.None,
Symbols\MissingSpecialMember.cs (14)
124var comp = CreateEmptyCompilation(source, new[] { Net40.mscorlib }, options: TestOptions.ReleaseDll); 269var comp = CreateEmptyCompilation(source); 351validatePresent(CreateEmptyCompilation(string.Format(sourceTemplate, "public"))); 352validatePresent(CreateEmptyCompilation(string.Format(sourceTemplate, "internal"))); 486var corlibRef = CreateEmptyCompilation(corlibSource, parseOptions: parseOptions).EmitToImageReference(expectedWarnings: new[] 492var publicLibRef = CreateEmptyCompilation(string.Format(libSourceTemplate, "public"), new[] { corlibRef }, parseOptions: parseOptions).EmitToImageReference(); 493var internalLibRef = CreateEmptyCompilation(string.Format(libSourceTemplate, "internal"), new[] { corlibRef }, parseOptions: parseOptions).EmitToImageReference(); 495var comp = CreateEmptyCompilation("", new[] { corlibRef, publicLibRef, internalLibRef }, assemblyName: "Test"); 509var comp1 = CreateEmptyCompilation(source, parseOptions: parseOptions); 518var comp2 = CreateEmptyCompilation("", new[] { reference }, parseOptions: parseOptions); 526var comp = CreateEmptyCompilation("", new[] { MscorlibRef_v4_0_30316_17626 }); 549var comp = CreateEmptyCompilation("", new[] { MscorlibRef_v4_0_30316_17626 }); 589var comp = CreateEmptyCompilation("", refs); 926var comp = CreateEmptyCompilation("", refs);
Symbols\OverriddenOrHiddenMembersTests.cs (1)
2865var compilation = CreateEmptyCompilation(text, new MetadataReference[] { MscorlibRef_v20 });
Symbols\Retargeting\NoPia.cs (2)
282var LocalTypes1 = CreateEmptyCompilation(s_sourceLocalTypes1_IL, new[] { MscorlibRef }, options: TestOptions.ReleaseDll, assemblyName: "LocalTypes1"); 285var LocalTypes2 = CreateEmptyCompilation(s_sourceLocalTypes2_IL, new[] { MscorlibRef }, options: TestOptions.ReleaseDll, assemblyName: "LocalTypes2");
Symbols\Retargeting\RetargetCustomAttributes.cs (2)
297var c1 = CreateEmptyCompilation(source1, new[] { OldMsCorLib }); 298var c2 = CreateEmptyCompilation(source2, new MetadataReference[] { NewMsCorLib, new CSharpCompilationReference(c1) });
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (2)
451var ref1 = CreateEmptyCompilation("").ToMetadataReference(); 460var compilation2 = CreateCompilation(source2, references: new[] { compilation1.ToMetadataReference(), ref1, CreateEmptyCompilation("").ToMetadataReference() });
Symbols\Retargeting\RetargetingTests.cs (12)
333var comp = CreateEmptyCompilation(source); 370var comp = CreateEmptyCompilation(source); 430var comp = CreateEmptyCompilation(source); 509var comp = CreateEmptyCompilation(source); 570var comp = CreateEmptyCompilation(source); 631var comp = CreateEmptyCompilation(source); 730var comp1 = CreateEmptyCompilation(source, new[] { MscorlibRef_v20 }, TestOptions.ReleaseDll); 735var comp2 = CreateEmptyCompilation("", new[] { MscorlibRef_v4_0_30316_17626, new CSharpCompilationReference(comp1) }, TestOptions.ReleaseDll); 1051var unmanagedCallersOnlyAssembly = CreateEmptyCompilation(@" 1065var finalComp = CreateEmptyCompilation(@"C.M(1);", options: TestOptions.ReleaseExe, references: new[] { afterRetargeting.ToMetadataReference(), unmanagedCallersOnlyAssembly.ToMetadataReference() }); 1129var unmanagedCallersOnlyAssembly = CreateEmptyCompilation(@" 1142var finalComp = CreateEmptyCompilation(@"C.M(1);", options: TestOptions.ReleaseExe, references: new[] { afterRetargeting.ToMetadataReference(), unmanagedCallersOnlyAssembly.ToMetadataReference() });
Symbols\Source\BaseClassTests.cs (26)
34var comp = CreateEmptyCompilation(text); 54var comp = CreateEmptyCompilation(text); 101var comp = CreateEmptyCompilation(text); 130var comp = CreateEmptyCompilation(text); 232var comp = CreateEmptyCompilation(text); 261var comp = (Compilation)CreateEmptyCompilation(text); 298var comp = (Compilation)CreateEmptyCompilation(text); 461var comp = CreateEmptyCompilation(text); 479var comp = CreateEmptyCompilation(text); 497var comp = CreateEmptyCompilation(text); 517var comp = CreateEmptyCompilation(text); 531var comp = CreateEmptyCompilation(text); 546var comp = CreateEmptyCompilation(text); 564var comp = CreateEmptyCompilation(text); 584var comp = CreateEmptyCompilation(text); 603var comp = CreateEmptyCompilation(text); 623var comp = CreateEmptyCompilation(text); 648var comp = CreateEmptyCompilation(text); 667var comp = CreateEmptyCompilation(text); 684var comp = CreateEmptyCompilation(text); 1252var comp = CreateEmptyCompilation(text); 1277var comp = CreateEmptyCompilation(text); 1299var comp = CreateEmptyCompilation(text); 1318var comp = CreateEmptyCompilation(text); 1334var comp = CreateEmptyCompilation(text); 1378var comp = CreateEmptyCompilation(new[] { text1, text2 });
Symbols\Source\ClsComplianceTests.cs (1)
3314var comp = CreateEmptyCompilation(source, WinRtRefs, options: TestOptions.ReleaseWinMD);
Symbols\Source\CompletionTests.cs (1)
32var comp = CreateEmptyCompilation(text, skipUsesIsNullable: true);
Symbols\Source\CustomModifierCopyTests.cs (22)
815var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 859var comp1 = CreateEmptyCompilation(source1, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 891var comp2 = CreateEmptyCompilation(source2, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 915var comp3 = CreateEmptyCompilation(source3, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 936var comp4 = CreateEmptyCompilation(source4, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 989var comp1 = CreateEmptyCompilation(source1, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1013var comp2 = CreateEmptyCompilation(source2, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1027var comp3 = CreateEmptyCompilation(source3, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1136var comp1 = CreateEmptyCompilation(source1, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1177var comp2 = CreateEmptyCompilation(source2, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1205var comp3 = CreateEmptyCompilation(source3, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1252var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1292var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1337var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1381var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1436var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1490var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1540var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1625var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1742var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1839var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1941var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
Symbols\Source\DelegateTests.cs (2)
29var comp = CreateEmptyCompilation(text); 54var comp = CreateEmptyCompilation(
Symbols\Source\EnumTests.cs (1)
933var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef });
Symbols\Source\EventTests.cs (3)
370var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef }); 382var libComp = CreateEmptyCompilation(source, new[] { MscorlibRef }).VerifyDiagnostics( 399var libComp = CreateEmptyCompilation(source, references: new[] { MscorlibRef }).VerifyDiagnostics(
Symbols\Source\FieldTests.cs (3)
60var comp = CreateEmptyCompilation(text); 117var comp = CreateEmptyCompilation(text); 141var comp = CreateEmptyCompilation(text);
Symbols\Source\LocationTests.cs (1)
26var comp = CreateEmptyCompilation(text, new[] { MscorlibRef });
Symbols\Source\MethodTests.cs (1)
1408var comp = CreateEmptyCompilation(text);
Symbols\Source\SourcePlusMetadataTests.cs (2)
187var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef }); 203var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef });
Symbols\Source\TypeMapTests.cs (1)
53var comp = CreateEmptyCompilation(text);
Symbols\StaticAbstractMembersInInterfacesTests.cs (1)
31798references: new[] { CreateEmptyCompilation("").ToMetadataReference() });
Symbols\SymbolDistinguisherTests.cs (2)
314var dummyComp = CreateEmptyCompilation("", assemblyName: "Error"); 316var validType = CreateEmptyCompilation("", new[] { MscorlibRef }).GetSpecialType(SpecialType.System_Int32);
Symbols\SymbolErrorTests.cs (8)
8600CreateEmptyCompilation(text).VerifyDiagnostics( 9572CreateEmptyCompilation(text).VerifyDiagnostics( 9595CreateEmptyCompilation(text).VerifyDiagnostics( 9616CreateEmptyCompilation(text).VerifyDiagnostics( 14859var compilation = CreateEmptyCompilation(source, new[] { TestMetadata.Net40.mscorlib }); 18992var netModule = CreateEmptyCompilation("", options: TestOptions.ReleaseModule, assemblyName: "lib").EmitToImageReference(expectedWarnings: new[] { Diagnostic(ErrorCode.WRN_NoRuntimeMetadataVersion) }); 20797var forwarderCompilation = CreateEmptyCompilation( 20862var forwarderCompilation = CreateEmptyCompilation(
Symbols\TypeTests.cs (8)
536var compilation = CreateEmptyCompilation(text, new[] { TestMetadata.Net40.mscorlib }); 803var sysConsoleRef = CreateEmptyCompilation( 814var main1 = CreateEmptyCompilation( 827var main2 = CreateEmptyCompilation( 925var comp = CreateEmptyCompilation(text); 943var comp = CreateEmptyCompilation(code); 979var comp = CreateEmptyCompilation(code); 992var comp = CreateEmptyCompilation(code);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
CSharpTestBase.cs (5)
1053return CreateEmptyCompilation(source, allReferences, options, parseOptions); 1192return CreateEmptyCompilation(source, TargetFrameworkUtil.GetReferences(targetFramework, references), options, parseOptions, assemblyName, sourceFileName, skipUsesIsNullable); 2189var reference = CreateEmptyCompilation( 2196var comp = CreateEmptyCompilation( 2208var comp = CreateEmptyCompilation(
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (22)
CodeGen\WinMdEventTests.cs (4)
622var comp1 = CreateEmptyCompilation(source1, WinRtRefs, TestOptions.ReleaseWinMD, TestOptions.Regular, "Lib"); 626var comp2 = CreateEmptyCompilation(source2, WinRtRefs.Concat(new MetadataReference[] { new CSharpCompilationReference(comp1), serializationRef, SystemXmlRef }), TestOptions.ReleaseExe); 647var comp = CreateEmptyCompilation(source, WinRtRefs, TestOptions.ReleaseWinMD, TestOptions.Regular7); 667var comp = CreateEmptyCompilation(source, WinRtRefs, TestOptions.ReleaseWinMD);
CodeGen\WinRTCollectionTests.cs (3)
47var comp = CreateEmptyCompilation(source, references: WinRtRefs); 353var comp = CreateEmptyCompilation(source, references: WinRtRefs); 7417var comp = CreateEmptyCompilation(source, references: WinRtRefs);
Metadata\WinMdDumpTest.cs (1)
444var comp = CreateEmptyCompilation("", references, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.All));
Metadata\WinMdEventTests.cs (14)
238_eventLibRef = CreateEmptyCompilation( 307var dynamicCommon = CreateEmptyCompilation( 2839var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { ilRef })); 2914var comp = CreateEmptyCompilation(source, WinRtRefs, TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug)); 2958var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { ilRef }), TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug)); 3027var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { interfaceILRef, baseILRef }), TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug)); 3093var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { ilRef }), TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug)); 3165var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { ilRef })); 3192var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { ilRef })); 3218var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { interfaceILRef, baseILRef })); 3249var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { interfaceILRef, baseILRef })); 3288var comp = CreateEmptyCompilation(source, WinRtRefs, TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug)); 3379CreateEmptyCompilation(source, WinRtRefs, TestOptions.ReleaseWinMD).VerifyDiagnostics( 3556var comp = CreateEmptyCompilation("", WinRtRefs.Concat(new[] { ilRef }), TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All));