10 instantiations of CSharpTestSource
Microsoft.CodeAnalysis.CSharp.Test.Utilities (10)
CSharpTestSource.cs (10)
24public static CSharpTestSource None => new CSharpTestSource(null); 89public static implicit operator CSharpTestSource(string source) => new CSharpTestSource(source); 90public static implicit operator CSharpTestSource(string[] source) => new CSharpTestSource(source); 91public static implicit operator CSharpTestSource((string Source, string FileName) source) => new CSharpTestSource(source); 92public static implicit operator CSharpTestSource((string Source, string FileName)[] source) => new CSharpTestSource(source); 93public static implicit operator CSharpTestSource(SyntaxTree source) => new CSharpTestSource(source); 94public static implicit operator CSharpTestSource(SyntaxTree[] source) => new CSharpTestSource(source); 95public static implicit operator CSharpTestSource(List<SyntaxTree> source) => new CSharpTestSource(source.ToArray()); 96public static implicit operator CSharpTestSource(ImmutableArray<SyntaxTree> source) => new CSharpTestSource(source.ToArray()); 97public static implicit operator CSharpTestSource(CSharpTestSource[] source) => new CSharpTestSource(source);
104 references to CSharpTestSource
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (7)
CodeGen\CodeGenAsyncIteratorTests.cs (2)
135=> CreateCompilationWithTasksExtensions(new[] { (CSharpTestSource)CSharpTestBase.Parse(source, filename: "source", parseOptions), CSharpTestBase.Parse(AsyncStreamsTypes, filename: "AsyncStreamsTypes", parseOptions) }, 138private CSharpCompilation CreateCompilationWithAsyncIterator(CSharpTestSource source, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null)
CodeGen\CodeGenExprLambdaTests.cs (1)
18CSharpTestSource source,
CodeGen\CodeGenFunctionPointersTests.cs (3)
29CSharpTestSource sources, 46private static CSharpCompilation CreateCompilationWithFunctionPointers(CSharpTestSource source, IEnumerable<MetadataReference>? references = null, CSharpCompilationOptions? options = null, TargetFramework? targetFramework = null) 51private static CSharpCompilation CreateCompilationWithFunctionPointers(CSharpTestSource source, bool includeUnmanagedCallersOnly, CSharpCompilationOptions? options = null)
Emit\EditAndContinue\EditAndContinueTestBase.cs (1)
323internal static CSharpCompilation WithSource(this CSharpCompilation compilation, CSharpTestSource newSource)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (9)
Attributes\AttributeTests_NullablePublicOnly.cs (7)
33CSharpTestSource sources = new[] { NullablePublicOnlyAttributeDefinition, source }; 218CSharpTestSource sources = new[] { NullableAttributeDefinition, NullableContextAttributeDefinition, source }; 272CSharpTestSource sources = new[] { NullableAttributeDefinition, NullableContextAttributeDefinition, NullablePublicOnlyAttributeDefinition, source }; 292CSharpTestSource sources = new[] { NullableAttributeDefinition, NullableContextAttributeDefinition, NullablePublicOnlyAttributeDefinition, source }; 311CSharpTestSource sources = new[] { NullableAttributeDefinition, NullableContextAttributeDefinition, source }; 331CSharpTestSource sources = new[] { NullableAttributeDefinition, NullableContextAttributeDefinition, source }; 378CSharpTestSource sources = new[] { NullableAttributeDefinition, NullableContextAttributeDefinition, NullablePublicOnlyAttributeDefinition, source };
Diagnostics\GetDiagnosticsTests.cs (1)
313var compilation = CreateCompilationWithMscorlib45(CSharpTestSource.None).WithEventQueue(new AsyncQueue<CompilationEvent>());
Emit\NumericIntPtrTests.cs (1)
11593CompilationVerifier compileAndVerify(CSharpTestSource source)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IInterpolatedStringOperation.cs (1)
17private static CSharpTestSource GetSource(string code, bool hasDefaultHandler)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\AnonymousFunctionTests.cs (1)
22internal CompilationVerifier VerifyInPreview(CSharpTestSource source, string expectedOutput, Action<ModuleSymbol>? symbolValidator = null, params DiagnosticDescription[] expected)
Semantics\NullableReferenceTypesTests.cs (1)
95private CSharpCompilation CreateNullableCompilation(CSharpTestSource source,
Semantics\RecordStructTests.cs (2)
26private static CSharpCompilation CreateCompilation(CSharpTestSource source) 31CSharpTestSource src,
Semantics\RecordTests.cs (2)
23private static CSharpCompilation CreateCompilation(CSharpTestSource source) 28CSharpTestSource src,
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (17)
Compilation\GetImportScopesTests.cs (1)
397private static CSharpCompilation CreateCompilationWithExternAlias(CSharpTestSource source, params string[] aliases)
DocumentationComments\DocumentationCommentCompilerTests.cs (5)
28CSharpTestSource source, 1279void verify(CSharpTestSource source) 1336void verify(CSharpTestSource source) 1399void verify(CSharpTestSource source) 1462void verify(CSharpTestSource source)
Symbols\CSharpCompilerFeatureRequiredTests.cs (4)
16public class CSharpCompilerFeatureRequiredTests : BaseCompilerFeatureRequiredTests<CSharpCompilation, CSharpTestSource> 22protected override CSharpTestSource GetUsage() => """ 58protected override CSharpCompilation CreateCompilationWithIL(CSharpTestSource source, string ilSource) 63protected override CSharpCompilation CreateCompilation(CSharpTestSource source, MetadataReference[] references)
Symbols\Metadata\PE\NoPiaLocalHideAndTypeSubstitutionTests.cs (4)
86var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy3", source: CSharpTestSource.None, 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\RequiredMembersTests.cs (1)
35private static CSharpCompilation CreateCompilationWithRequiredMembers(CSharpTestSource source, IEnumerable<MetadataReference>? references = null, CSharpParseOptions? parseOptions = null, CSharpCompilationOptions? options = null, string? assemblyName = null, TargetFramework targetFramework = TargetFramework.Standard)
Symbols\Source\RecordTests.cs (2)
16private static CSharpCompilation CreateCompilation(CSharpTestSource source) 19private CompilationVerifier CompileAndVerify(CSharpTestSource src, string? expectedOutput = null)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (50)
CSharpTestBase.cs (38)
714CSharpTestSource source, 750CSharpTestSource source, 786CSharpTestSource source, 828CSharpTestSource source, 864CSharpTestSource source, 900CSharpTestSource source, 979internal CompilationVerifier CompileAndVerifyFieldMarshal(CSharpTestSource source, Dictionary<string, byte[]> expectedBlobs, bool isField = true) => 989internal CompilationVerifier CompileAndVerifyFieldMarshal(CSharpTestSource source, Func<string, PEAssembly, byte[]> getExpectedBlob, bool isField = true) => 998=> CSharpTestSource.Parse(text, filename, options, encoding, checksumAlgorithm); 1034CSharpTestSource source, 1043CSharpTestSource source, 1057CSharpTestSource source, 1065CSharpTestSource source, 1083CSharpTestSource source, 1091CSharpTestSource source, 1101CSharpTestSource source, 1109CSharpTestSource source, 1117CSharpTestSource source, 1133CSharpTestSource source, 1141CSharpTestSource source, 1154CSharpTestSource source, 1183CSharpTestSource source, 1196CSharpTestSource source, 1206CSharpTestSource source, 1355CSharpTestSource? source, 1360var trees = (source ?? CSharpTestSource.None).GetSyntaxTrees(parseOptions); 1968CSharpTestSource testSrc, 2019CSharpTestSource testSrc, 2054CSharpTestSource testSrc, 2074CSharpTestSource testSrc, 2112CSharpTestSource testSrc, 2132CSharpTestSource testSrc, 2170protected static CSharpCompilation CreateCompilationWithSpan(CSharpTestSource tree, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2187protected static CSharpCompilation CreateCompilationWithMscorlibAndSpan(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2502protected static CSharpCompilation CreateCompilationWithIndex(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2513protected static CSharpCompilation CreateCompilationWithIndexAndRange(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2524protected static CSharpCompilation CreateCompilationWithIndexAndRangeAndSpan(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2535protected static CSharpCompilation CreateCompilationWithSpanAndMemoryExtensions(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null, TargetFramework targetFramework = TargetFramework.NetCoreApp)
CSharpTestSource.cs (12)
24public static CSharpTestSource None => new CSharpTestSource(null); 80case CSharpTestSource[] testSources: 89public static implicit operator CSharpTestSource(string source) => new CSharpTestSource(source); 90public static implicit operator CSharpTestSource(string[] source) => new CSharpTestSource(source); 91public static implicit operator CSharpTestSource((string Source, string FileName) source) => new CSharpTestSource(source); 92public static implicit operator CSharpTestSource((string Source, string FileName)[] source) => new CSharpTestSource(source); 93public static implicit operator CSharpTestSource(SyntaxTree source) => new CSharpTestSource(source); 94public static implicit operator CSharpTestSource(SyntaxTree[] source) => new CSharpTestSource(source); 95public static implicit operator CSharpTestSource(List<SyntaxTree> source) => new CSharpTestSource(source.ToArray()); 96public static implicit operator CSharpTestSource(ImmutableArray<SyntaxTree> source) => new CSharpTestSource(source.ToArray()); 97public static implicit operator CSharpTestSource(CSharpTestSource[] source) => new CSharpTestSource(source);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
EditAndContinue\EditAndContinueMethodDebugInfoReaderTests.cs (1)
64var tree = CSharpTestSource.Parse(source, path: "/a/c.cs", options: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), checksumAlgorithm: SourceHashAlgorithm.Sha1);
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
CSharpDeterministicKeyBuilderTests.cs (1)
83CSharpTestSource.Parse(@"System.Console.WriteLine(""Hello World"");", checksumAlgorithm: SourceHashAlgorithm.Sha1),
Microsoft.CodeAnalysis.UnitTests (9)
Analyzers\AnalyzerFileReferenceTests.cs (1)
485new[] { CSharpTestSource.Parse(generatorSource) },
Diagnostics\OperationTests.cs (1)
274var tree = CSharpTestSource.Parse(source);
Diagnostics\SuppressMessageAttributeCompilerTests.cs (2)
60syntaxTrees: new[] { CSharpTestSource.Parse(unconditionalSuppressMessageDef) }, 74CSharpTestSource.Parse(source, path: fileName) :
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (1)
1456CSharpTestSource.Parse(source, path: fileName) :
GivesAccessTo.cs (2)
22var csharpTree = CSharpTestSource.Parse(@" 29var csharpTree2 = CSharpTestSource.Parse(@"
IsSymbolAccessibleWithinTests.cs (1)
23var csharpTree = CSharpTestSource.Parse("class A { }");
MetadataReferences\MetadataReferenceTests.cs (1)
572syntaxTrees: new[] { CSharpTestSource.Parse("class C : System.Collections.ArrayList { }") },
VBCSCompiler.UnitTests (3)
AnalyzerConsistencyCheckerTests.cs (3)
58? new[] { CSharpTestSource.Parse(source) } 59: new[] { CSharpTestSource.Parse(source), CSharpTestSource.Parse(extraSource) };