650 references to Parse
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (81)
BreakingChanges.cs (2)
197var tree = Parse(text, options: TestOptions.RegularWithDocumentationComments); 216var tree = Parse(text, options: TestOptions.RegularWithDocumentationComments);
CodeGen\CodeGenAsyncIteratorTests.cs (2)
141=> CreateCompilationWithTasksExtensions(new[] { (CSharpTestSource)CSharpTestBase.Parse(source, filename: "source", parseOptions), CSharpTestBase.Parse(AsyncStreamsTypes, filename: "AsyncStreamsTypes", parseOptions) },
CodeGen\CodeGenAsyncTests.cs (1)
4991var compilation = CreateEmptyCompilation(new[] { Parse(source) });
CodeGen\CodeGenDynamicTests.cs (2)
7493new[] { Parse(sourceScript, options: TestOptions.Script) }, 7591new[] { Parse(sourceScript, options: TestOptions.Script) },
CodeGen\CodeGenExprLambdaTests.cs (4)
841CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(source), Parse(ExpressionTestLibrary) }).VerifyDiagnostics( 865CreateCompilationWithMscorlib46(new[] { Parse(source), Parse(ExpressionTestLibrary) }, new[] { ExpressionAssemblyRef }).VerifyDiagnostics(
CodeGen\CodeGenIterators.cs (6)
1942var parsed = new[] { Parse(source) }; 1974var parsed = new[] { Parse(source) }; 2394var compilation = CreateEmptyCompilation(new[] { Parse(source, options: parseOptions), Parse(corlib, options: parseOptions) }); 2439var compilation = CreateEmptyCompilation(new[] { Parse(source, options: TestOptions.Regular.WithNoRefSafetyRulesAttribute()) }); 2503var compilation = CreateEmptyCompilation(new[] { Parse(source, options: TestOptions.Regular.WithNoRefSafetyRulesAttribute()) });
CodeGen\CodeGenTests.cs (1)
475var tree = Parse(source);
CodeGen\CodeGenTupleTest.cs (40)
1600var tree = Parse(source, options: TestOptions.Regular); 5469var tree = Parse(source); 8287var tree = Parse(source, options: TestOptions.Regular); 8318var tree = Parse(source, options: TestOptions.Regular); 8373var tree = Parse(source, options: TestOptions.Regular); 8402var tree = Parse(source, options: TestOptions.Regular); 8431var tree = Parse(source, options: TestOptions.Regular); 8479var tree = Parse(source, options: TestOptions.Regular); 8513var tree = Parse(source, options: TestOptions.Regular); 8546var tree = Parse(source, options: TestOptions.Regular); 8575var tree = Parse(source, options: TestOptions.Regular); 8622var tree = Parse(source, options: TestOptions.Regular); 8657var tree = Parse(source, options: TestOptions.Regular); 8686var tree = Parse(source, options: TestOptions.Regular); 8715var tree = Parse(source, options: TestOptions.Regular); 8745var tree = Parse(source, options: TestOptions.Regular); 8800var tree = Parse(source, options: TestOptions.Regular); 8830var tree = Parse(source, options: TestOptions.Regular); 8889var tree = Parse(source, options: TestOptions.Regular); 8936var tree = Parse(source, options: TestOptions.Regular); 9007var tree = Parse(source, options: TestOptions.Regular); 9059var tree = Parse(source, options: TestOptions.Regular); 9136var tree = Parse(source, options: TestOptions.Regular); 9217var tree = Parse(source, options: TestOptions.Regular); 9300var tree = Parse(source, options: TestOptions.Regular); 9354var tree = Parse(source, options: TestOptions.Regular); 16562var tree = Parse(source, options: TestOptions.Regular); 16599var tree = Parse(source, options: TestOptions.Regular); 17205var tree = Parse(source, options: TestOptions.Regular); 17266var tree = Parse(source, options: TestOptions.Regular); 17325var tree = Parse(source, options: TestOptions.Regular); 17364var tree = Parse(source, options: TestOptions.Regular); 17396var tree = Parse(source, options: TestOptions.Regular7_1); 17429var tree = Parse(source, options: TestOptions.Regular7_1); 19058var tree = Parse(text); 19097var tree = Parse(text); 19136var tree = Parse(text); 19175var tree = Parse(text); 25316var corlibWithoutVT = CreateEmptyCompilation(new[] { Parse(String.Format(versionTemplate, "1") + corlib_cs, options: parseOptions) }, assemblyName: "corlib"); 25320var corlibWithVT = CreateEmptyCompilation(new[] { Parse(String.Format(versionTemplate, "2") + corlib_cs + valuetuple_cs, options: parseOptions) }, assemblyName: "corlib");
CodeGen\GotoTest.cs (2)
1146var tree = Parse(source, options: TestOptions.Script); 1159var tree = Parse(source, options: TestOptions.Script);
CodeGen\SwitchTests.cs (1)
4513source: new[] { Parse(text) },
Emit\CompilationEmitTests.cs (4)
1205CSharpCompilation comp1 = CreateCompilation(Parse(source1), options: TestOptions.DebugDll.WithDeterministic(true), assemblyName: name); 1209Compilation comp2 = CreateCompilation(Parse(source2), options: TestOptions.DebugDll.WithDeterministic(true), assemblyName: name); 2095CSharpCompilation comp = CreateCompilation(Parse(source), 3464new[] { Parse(source) },
Emit\DynamicAnalysis\DynamicAnalysisResourceTests.cs (13)
75var c = CreateCompilation(Parse(ExampleSource + InstrumentationHelperSource, @"C:\myproject\doc1.cs"), references: new[] { RefSafetyRulesAttributeLib }); 219var c = CreateCompilation(Parse(source + InstrumentationHelperSource, @"C:\myproject\doc1.cs"), references: new[] { RefSafetyRulesAttributeLib }); 339var c = CreateCompilation(Parse(source + InstrumentationHelperSource, @"C:\myproject\doc1.cs"), references: new[] { RefSafetyRulesAttributeLib }); 433var c = CreateCompilation(Parse(source + InstrumentationHelperSource, @"C:\myproject\doc1.cs"), references: new[] { RefSafetyRulesAttributeLib }); 490var c = CreateCompilation(Parse(source + InstrumentationHelperSource, @"C:\myproject\doc1.cs"), references: new[] { RefSafetyRulesAttributeLib }); 529var c = CreateCompilation(Parse(source + InstrumentationHelperSource, @"C:\myproject\doc1.cs"), references: new[] { RefSafetyRulesAttributeLib }); 560var c = CreateCompilation(Parse(source + InstrumentationHelperSource, @"C:\myproject\doc1.cs"), references: new[] { RefSafetyRulesAttributeLib }); 600var c = CreateCompilation(Parse(source + InstrumentationHelperSource, @"C:\myproject\doc1.cs"), references: new[] { RefSafetyRulesAttributeLib }); 668var c = CreateCompilation(Parse(source + InstrumentationHelperSource, @"C:\myproject\doc1.cs"), references: new[] { RefSafetyRulesAttributeLib }); 749var c = CreateCompilation(Parse(source + InstrumentationHelperSource, @"C:\myproject\doc1.cs"), references: new[] { RefSafetyRulesAttributeLib }); 830var c = CreateCompilation(Parse(source + InstrumentationHelperSource, @"C:\myproject\doc1.cs"), references: new[] { RefSafetyRulesAttributeLib }); 924var c = CreateCompilation(Parse(source + InstrumentationHelperSource, @"C:\myproject\doc1.cs"), references: new[] { RefSafetyRulesAttributeLib }); 957var c = CreateCompilation(Parse(ExampleSource + InstrumentationHelperSource, @"C:\myproject\doc1.cs"));
Emit\DynamicAnalysis\DynamicInstrumentationTests.cs (1)
3658trees.Add(Parse(source.Content, filename: source.Path));
Emit\EntryPointTests.cs (2)
283Parse(csx, options: TestOptions.Script), 284Parse(cs, options: TestOptions.Regular)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (45)
Emit\EditAndContinue\EditAndContinueTestBase.cs (1)
50parser: s => Parse(s, fileName, options ?? TestOptions.Regular.WithNoRefSafetyRulesAttribute()),
Emit\EditAndContinue\LocalSlotMappingTests.cs (2)
751var asyncStreamsTree = Parse(AsyncStreamsTypes, options: (CSharpParseOptions)source0.Tree.Options); 842var asyncStreamsTree = Parse(AsyncStreamsTypes, options: (CSharpParseOptions)source0.Tree.Options);
PDB\CheckSumTest.cs (4)
24new[] { Parse(source, filePath) }, 233var compilation = CreateCompilation(new[] { Parse(text1, "a.cs"), Parse(text2, "b.cs") }); 297new[] { Parse(@"
PDB\CSharpDeterministicBuildCompilationTests.cs (9)
99var sourceOne = Parse(@" 111var sourceTwo = Parse(@" 116var sourceThree = Parse(@" 159var sourceOne = Parse(@" 171var sourceTwo = Parse(@" 176var sourceThree = Parse(@" 223var sourceOne = Parse(@" 235var sourceTwo = Parse(@" 240var sourceThree = Parse(@"
PDB\PDBEmbeddedSourceTests.cs (3)
42var tree1 = Parse(source1, "f:/build/goo.cs"); 43var tree2 = Parse(source2, "f:/build/nocode.cs"); 103var tree = Parse(source, "f:/build/goo.cs");
PDB\PDBSourceLinkTests.cs (5)
51var c = CreateCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); 81var c = CreateCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); 121var c = CreateCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); 143var c = CreateCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); 185var c = CreateCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll);
PDB\PDBTests.cs (16)
173new[] { Parse(text1, @"C:\Folder1\Folder2\Test1.cs") }, 217new[] { Parse(text1, @"/Folder1/Folder2/Test1.cs") }, 608var tree1 = Parse(source1, @"foo.cs"); 609var tree2 = Parse(source2, @"foo.cs"); 4966var compilation = CreateCompilation(new SyntaxTree[] { Parse(text1, "a.cs"), Parse(text2, "b.cs") }); 5062var compilation = CreateCompilation(new[] { Parse(text1, "a.cs"), Parse(text2, "b.cs"), Parse(text3, "a.cs") }, options: TestOptions.DebugDll); 8032var c = CreateCompilation(Parse(source, filename: "file.cs")); 12403new[] { Parse(initializerSource, "initializer.cs"), Parse(constructorSource, "constructor.cs") }, 12909var tree1 = Parse(source1, "f:/build/goo.cs"); 12910var tree2 = Parse(source2, "f:/build/nocode.cs"); 12948var tree = Parse(source, "f:/build/nocode.cs"); 12971new[] { Parse(source, "a.cs") },
PDB\PortablePdbTests.cs (5)
166var c = CreateCompilation(Parse(source, "goo.cs"), options: TestOptions.DebugDll); 226var c = CreateCompilation(Parse(source, "goo.cs"), options: TestOptions.DebugDll.WithDeterministic(true)); 301var c = CreateCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); 342var c = CreateCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); 381var c = CreateCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (64)
Attributes\AttributeTests.cs (2)
87var nodes = Parse(aliases).GetRoot().DescendantNodes().OfType<UsingDirectiveSyntax>(); 4883syntaxTrees: new[] { Parse("public enum Bar { Baz }") }).EmitToStream(options: new EmitOptions(metadataOnly: true));
Attributes\AttributeTests_Experimental.cs (26)
66var comp1 = CreateCompilation(new[] { Parse(ExperimentalAttributeSource), Parse(source1) }); 207var comp = CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(DeprecatedAttributeSource), Parse(ExperimentalAttributeSource), Parse(source) }); 306var comp = CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(DeprecatedAttributeSource), Parse(ExperimentalAttributeSource), Parse(source) }); 348var comp = CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(DeprecatedAttributeSource), Parse(ExperimentalAttributeSource), Parse(source) }); 368var comp = CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(ExperimentalAttributeSource), Parse(source) }); 397var comp = CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(ExperimentalAttributeSource), Parse(source) }); 426var comp = CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(ExperimentalAttributeSource), Parse(source) }); 457var comp = CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(ExperimentalAttributeSource), Parse(source) }); 494var comp = CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(ExperimentalAttributeSource), Parse(source) }); 533var comp1 = CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(DeprecatedAttributeSource), Parse(ExperimentalAttributeSource), Parse(source1) }); 634var comp = CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(ExperimentalAttributeSource), Parse(source) });
Attributes\AttributeTests_Security.cs (2)
1501var syntaxTree = Parse(source); 1619var syntaxTree = Parse(source);
Attributes\AttributeTests_Synthesized.cs (1)
1959var comp = CreateEmptyCompilation(new SyntaxTree[] { Parse("", options: parseOptions) }, references: new[] { diagLibRef, mslibNoStringRef });
Attributes\AttributeTests_WellKnownAttributes.cs (10)
5103var syntaxTree = Parse(source, filename: "test.cs"); 5142var syntaxTree = Parse(source, filename: "test.cs", options: parseOptions); 7333var comp = CreateCompilation(new[] { Parse(source0), Parse(source1) }); 7384var comp = CreateCompilation(new[] { Parse(source0), Parse(source1) }); 9964var compilation1 = CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(DeprecatedAttributeSourceTH1), Parse(source1) }); 10047var compilation1 = CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(DeprecatedAttributeSourceTH2), Parse(source1) });
Attributes\InternalsVisibleToAndStrongNameTests.cs (5)
138var syntaxTree = Parse(s, @"IVTAndStrongNameTests\AnotherTempDir\temp.cs", parseOptions); 167var syntaxTree = Parse(s, @"IVTAndStrongNameTests\AnotherTempDir\temp.cs", parseOptions); 227var syntaxTree = Parse(s, @"IVTAndStrongNameTests\AnotherTempDir\temp.cs", TestOptions.RegularWithLegacyStrongName); 295var syntaxTree = Parse(s, @"IVTAndStrongNameTests\AnotherTempDir\temp.cs"); 337var syntaxTree = Parse(s, @"IVTAndStrongNameTests\AnotherTempDir\temp.cs");
Diagnostics\DiagnosticAnalyzerTests.cs (8)
3369var tree1 = Parse("partial class A { }"); 3370var tree2 = Parse("partial class A { private class B { } }"); 3412var tree1 = Parse("partial class A { }"); 3413var tree2 = Parse("partial class A { private class B { } }"); 3465var tree1 = Parse("partial class A { }"); 3466var tree2 = Parse("partial class A { private class B { } }"); 3516var tree1 = Parse("partial class A { }"); 3517var tree2 = Parse("partial class A { private class B { } }");
Diagnostics\GetDiagnosticsTests.cs (8)
429var syntaxTree1 = Parse(string.Empty, options: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "1" })); 430var syntaxTree2 = Parse(string.Empty, options: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "2" })); 431var syntaxTree3 = Parse(string.Empty, options: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "3" })); 458var syntaxTree1 = Parse(string.Empty, options: parseOptions1); 459var syntaxTree2 = Parse(string.Empty, options: parseOptions2); 460var syntaxTree3 = Parse(string.Empty, options: parseOptions2); 482var tree1 = Parse(string.Empty, options: parseOptions); 483var tree2 = Parse("ref struct X {}", options: parseOptions);
Semantics\OutVarTests.cs (2)
34326var syntaxTree = Parse(source, filename: "file.cs"); 34540var syntaxTree = Parse(source, filename: "file.cs");
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (7)
IOperation\IOperationTests_ICompoundAssignmentOperation.cs (2)
43var syntaxTree = Parse(source); 79var syntaxTree = Parse(source);
IOperation\IOperationTests_IVariableDeclaration.cs (5)
922var tree = Parse(source, options: TestOptions.Regular); 1214var syntaxTree = Parse(source, filename: "file.cs"); 2300var syntaxTree = Parse(source, filename: "file.cs"); 2361var syntaxTree = Parse(source, filename: "file.cs"); 2829var syntaxTree = Parse(source, filename: "file.cs");
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (92)
Semantics\AccessibilityTests.cs (1)
25var t = Parse(@"
Semantics\ArglistTests.cs (1)
956var tree = Parse(text);
Semantics\AwaitExpressionTests.cs (1)
154var tree = Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5));
Semantics\ColorColorTests.cs (10)
588var tree = Parse(text); 627var tree = Parse(text); 724var tree = Parse(text); 1057var tree = Parse(text); 1103var tree = Parse(text); 1149var tree = Parse(text); 1194var tree = Parse(text); 1235var tree = Parse(text); 1272var tree = Parse(text); 1837var tree = Parse(text);
Semantics\ConditionalOperatorTests.cs (1)
1283var tree = Parse(source, options: parseOptions);
Semantics\DynamicTests.cs (3)
3037CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(source, options: TestOptions.RegularPreview) }).VerifyDiagnostics( 3107CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(source, options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)) }).VerifyDiagnostics( 3224CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(source, options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)) }).VerifyDiagnostics(
Semantics\ExpressionBodiedMemberTests.cs (1)
113var tree = Parse(@"
Semantics\ForEachTests.cs (1)
3253var tree = Parse(text, options: options);
Semantics\ImplicitlyTypeArraysTests.cs (2)
63var tree = Parse(text); 89var tree = Parse(text);
Semantics\ImportsTests.cs (1)
142var trees = sources.Select(source => Parse(source)).ToArray();
Semantics\LambdaTests.cs (10)
337var comp = CreateCompilation(Parse(text)); 370new[] { Parse(text1) }, 384new[] { Parse(text2) }, 416Parse(text1), 432Parse(text2), 444Parse(text2), 474var comp = CreateCompilation(Parse(text1)); 529Parse(csSource), 575var csProject = CreateCompilation(Parse(csSource), new[] { MetadataReference.CreateFromImage(vbMetadata) }); 8227var tree = Parse(source);
Semantics\LookupTests.cs (4)
36var tree = Parse(testSrc, options: isScript ? TestOptions.Script : TestOptions.Regular); 617var srcTrees = new SyntaxTree[] { Parse(testSrc) }; 674var srcTrees = new SyntaxTree[] { Parse(testSrc) }; 1366var tree = Parse(source);
Semantics\MethodBodyModelTests.cs (34)
54var tree = Parse(text); 76var tree = Parse(text); 99var tree = Parse(text); 122var tree = Parse(text); 162var tree = Parse(text); 202var tree = Parse(text); 242var tree = Parse(text); 265var tree = Parse(text); 293var tree = Parse(text); 324var tree = Parse(text); 369var tree = Parse(text); 393var tree = Parse(text); 416var tree = Parse(text); 440var tree = Parse(text); 463var tree = Parse(text); 486var tree = Parse(text); 509var tree = Parse(text); 532var tree = Parse(text); 563var tree = Parse(text); 615var tree = Parse(text); 639var tree = Parse(text); 666var tree = Parse(text); 698var tree = Parse(text); 725var tree = Parse(text); 750var tree = Parse(text); 770var tree = Parse(text); 795var tree = Parse(text); 832var tree = Parse(text); 859var tree = Parse(text); 884var tree = Parse(text); 911var tree = Parse(text); 932var tree = Parse(text); 953var tree = Parse(text); 992var tree = Parse(text);
Semantics\NullableReferenceTypesTests.cs (1)
7768var tree = Parse(source);
Semantics\PropertyAccessTests.cs (1)
34source: new[] { Parse(text) },
Semantics\ScriptSemanticsTests.cs (7)
519var tree = Parse(source, options: TestOptions.Script); 535var tree = Parse(source, options: TestOptions.Script); 627var compilation = CreateCompilationWithMscorlib461(new[] { Parse(source, options: TestOptions.Script) }); 640var compilation = CreateCompilationWithMscorlib461(new[] { Parse(source, options: TestOptions.Script) }); 652var compilation = CreateCompilationWithMscorlib461(new[] { Parse(source, options: TestOptions.Script) }); 1134var tree = Parse(source, options: TestOptions.Script); 1154var tree = Parse(source, options: TestOptions.Script);
Semantics\SemanticErrorTests.cs (3)
3322var tree = Parse(text); 7892var comp = CreateCompilation(new[] { Parse(test, options: TestOptions.Regular6) }, new MetadataReference[] { }); 21900new[] { Parse(text, options: TestOptions.RegularWithDocumentationComments) },
Semantics\StructsTests.cs (2)
377new[] { Parse(@"public struct S { }") }, 382new[] { Parse(@"public class C { void M() { S s = new S(); System.Console.WriteLine(s);} }") },
Semantics\TargetTypedConditionalOperatorTests.cs (1)
331var tree = Parse(source, options: parseOptions);
Semantics\TopLevelStatementsTests.cs (4)
1982Assert.Throws<System.ArgumentException>(() => CreateCompilation(new[] { Parse(text1, filename: "text1", DefaultParseOptions), 1983Parse(text1, filename: "text2", TestOptions.Regular6) }, 8766var oldTree = Parse(text: text1, options: TestOptions.RegularDefault); 8798var fullParseTree = Parse(text: text2, options: TestOptions.RegularDefault);
Semantics\UnsafeTests.cs (2)
11802var tree = Parse(sourceCode); 11899var tree = Parse(sourceCode);
Semantics\UseSiteErrorTests.cs (1)
2267new[] { Parse(corLibText) },
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (346)
Compilation\CompilationAPITests.cs (21)
559var t1 = Parse(@" 567var t2 = Parse(@" 575var t3 = Parse(@" 582var t4 = Parse(@" 1690var compilation = CSharpCompilation.Create(assemblyName: null, options: TestOptions.ReleaseModule, syntaxTrees: new[] { Parse(source) }, references: new[] { MscorlibRef }); 1698compilation = CSharpCompilation.Create(assemblyName: null, options: TestOptions.ReleaseDll, syntaxTrees: new[] { Parse(source) }, references: new[] { MscorlibRef }); 1706compilation = CSharpCompilation.Create(assemblyName: "ModuleAssemblyName", options: TestOptions.ReleaseModule, syntaxTrees: new[] { Parse(source) }, references: new[] { MscorlibRef }); 1742syntaxTree: Parse("true", options: TestOptions.Script) 1750syntaxTree: Parse("false", options: TestOptions.Script)) 1812syntaxTree: Parse(source, options: TestOptions.Script)); 1836syntaxTree: Parse(source, options: TestOptions.Script)); 2066var ta = Parse("class C { }", options: TestOptions.Regular10); 2068var tb = Parse(@" 2071var tc = Parse(@" 2075var tr = Parse(@" 2079var ts = Parse(@" 2208var c3 = c2.AddSyntaxTrees(Parse("public class Main2 { public static int a; }")); 2256new[] { Parse("") }, 2277new[] { Parse("") }, 2313new[] { Parse(src1) }, 2338new[] { Parse(src2) },
Compilation\GetImportScopesTests.cs (16)
21var tree = Parse(text); 412var tree = Parse(text); 431var tree = Parse(text); 453var tree = Parse(text); 474var tree = Parse(text); 494var tree = Parse(text); 510var tree = Parse(text); 530var tree = Parse(text); 561var tree = Parse(text); 586var tree = Parse(text); 612var tree = Parse(text); 613var comp = CreateCompilationWithExternAlias(new[] { tree, Parse(globalImportsText) }); 641var tree = Parse(text); 642var comp = CreateCompilationWithExternAlias(new[] { tree, Parse(globalImportsText) }); 674var tree = Parse(text); 675var comp = CreateCompilationWithExternAlias(new[] { tree, Parse(globalImportsText) });
Compilation\GetSemanticInfoBrokenCodeTests.cs (12)
28var tree = Parse(text); 47var tree = Parse(text); 70var tree = Parse(text); 93var tree = Parse(text); 106var tree = Parse(text); 131var tree = Parse(text); 158var tree = Parse(text); 175var tree = Parse(text); 314var tree = Parse(text); 329var tree = Parse(text); 344var tree = Parse(text); 359var tree = Parse(text);
Compilation\GetSemanticInfoTests.cs (75)
39var tree = Parse(text); 69var tree = Parse(text); 98var tree = Parse(text); 132var tree = Parse(text); 161var tree = Parse(text); 187var tree = Parse(text); 238var tree = Parse(text); 291var tree = Parse(source); 370var tree = Parse(text); 412var tree = Parse(text); 439var tree = Parse(text); 473var tree = Parse(text); 526var tree = Parse(text); 593var tree = Parse(text); 626var tree = Parse(text); 1021var tree = Parse(text); 1129var tree = Parse(text, options: TestOptions.Script); 1160var tree = Parse(text); 1189var tree = Parse(text); 1213var tree = Parse(text); 1236var tree = Parse(text); 1262var tree = Parse(text); 1290var tree = Parse(text); 1318var tree = Parse(text); 1345var tree = Parse(text); 1372var tree = Parse(text); 1408var tree = Parse(text); 1446var tree = Parse(text); 1484var tree = Parse(text); 1520var tree = Parse(text); 1551var tree = Parse(text); 1573var tree = Parse(text); 1601var tree = Parse(text); 1626var tree = Parse(text); 1665var tree = Parse(text); 1697var tree = Parse(text); 1732var tree = Parse(text); 1767var tree = Parse(text); 1803var tree = Parse(text); 1839var tree = Parse(text); 1880var tree = Parse(text); 1909var tree = Parse(text); 1945var tree = Parse(text); 1981var tree = Parse(text); 2017var tree = Parse(text); 2052var tree = Parse(text); 2218var tree = Parse(string.Format(template, types, constraints)); 2316var tree = Parse(text); 2352var tree = Parse(text); 2388var tree = Parse(text); 2447var tree = Parse(text); 2504var tree = Parse(text); 2533var tree = Parse(text); 2716var tree = Parse(text); 2787var tree = Parse(text); 2833var tree = Parse(text); 2863var tree = Parse(text); 2956var tree = Parse(text); 3048var tree = Parse(text); 3090var tree = Parse(text); 3122var tree = Parse(text); 3164var tree = Parse(text); 3196var tree = Parse(text); 3239var tree = Parse(text); 3269var tree = Parse(text); 3323var tree = Parse(text); 3389var tree = Parse(text); 5778var tree1 = Parse(file1); 5779var tree2 = Parse(file2); 5816var tree1 = Parse(file1); 5817var tree2 = Parse(file2); 5818var tree3 = Parse(file3); 5860var tree1 = Parse(file1); 5861var tree2 = Parse(file2); 5862var tree3 = Parse(file3);
Compilation\GetUnusedImportDirectivesTests.cs (9)
32var tree = Parse(text); 89var tree = Parse(consoleApplicationSource); 172var tree = Parse(text); 190var tree = Parse(text); 214var signing = Parse(@" 226Parse(@" 248Parse(@" 389var tree = Parse("using System;", options: TestOptions.Script); 398var tree = Parse("using System;", options: TestOptions.Script);
Compilation\IndexedProperties_BindingTests.cs (1)
135var tree = Parse(source);
Compilation\LoadDirectiveTests.cs (5)
81var external2 = Parse(code, "external2.csx", TestOptions.Script); 90var external3 = Parse(@" 104var external4 = Parse("#load \"a.csx\"", "external4.csx", TestOptions.Script); 162var newTree = Parse(code, "a.csx", TestOptions.Script); 182newTree = Parse(code, "a.csx", TestOptions.Script);
Compilation\ReferenceManagerTests.cs (11)
740var tree = Parse(source); 864t1 = Parse($"#r \"{p2}\"", options: TestOptions.Script), 865t2 = Parse($"#r \"{p3}\"", options: TestOptions.Script), 866t3 = Parse("#r \"Lib\"", options: TestOptions.Script), 1277Parse("#r \"1\"", options: TestOptions.Script), 1278Parse("#r \"2.dll\"", options: TestOptions.Script), 1323Parse("#r \"throw\"", options: TestOptions.Script), 1335syntaxTrees: new[] { Parse("class C {}") }, 1340var c2 = c1.AddSyntaxTrees(Parse("class D { }")); 1349var t1 = Parse(@" 1355var t2 = Parse(@"
Compilation\SemanticModelAPITests.cs (39)
249var tree = Parse(text); 268var tree = Parse(text); 288var tree = Parse(text); 307var tree = Parse(text); 327var tree = Parse(text); 346var tree = Parse(text); 366var tree1 = Parse(text); 367var tree2 = Parse(text); 390var tree = Parse(text); 417var tree = Parse(text); 483var tree = Parse(text); 514var partial1Tree = Parse(partial1); 515var partial2Tree = Parse(partial2); 530var tree = Parse(text); 556var tree = Parse(text); 582var tree = Parse(text); 605var tree = Parse(text); 638var tree1 = Parse(text); 641var tree2 = Parse(text); 670var tree1 = Parse(text); 697var tree1 = Parse(text); 698var tree2 = Parse(text); 721var tree = Parse(text); 747var tree = Parse(text); 778var tree = Parse(text); 813var tree = Parse(text); 839var tree = Parse(text); 865var tree = Parse(text); 921var tree = Parse(text); 958var tree1 = Parse(text1); 959var tree2 = Parse(text2); 999var tree1 = Parse(text1); 1000var tree2 = Parse(text2); 1038var tree = Parse(text); 1069var tree = Parse(text); 1110var tree = Parse(text); 1154var tree = Parse(text); 1190var tree = Parse(text); 4769var tree = Parse(text);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
3898var tree = Parse(sourceCode); 3919var tree = Parse(sourceCode);
Compilation\SemanticModelGetSemanticInfoTests.cs (1)
12122var tree = Parse(sourceCode);
Compilation\UsedAssembliesTests.cs (5)
164yield return (comp.ReplaceSyntaxTree(tree, CSharpTestBase.Parse(builder.ToString(), tree.FilePath, (CSharpParseOptions)tree.Options)), before, after); 192yield return (comp.ReplaceSyntaxTree(tree, CSharpTestBase.Parse(builder.ToString(), tree.FilePath, parseOptions)), before, after); 203yield return (comp.ReplaceSyntaxTree(tree, CSharpTestBase.Parse(builder.ToString(), tree.FilePath, parseOptions)). 204AddSyntaxTrees(CSharpTestBase.Parse(globalUsings, "", parseOptions)), before, after); 2339AssertUsedAssemblyReferences(CreateCompilation(Parse(source, options: TestOptions.Script), references: new[] { reference }, options: TestOptions.DebugDll.WithUsings(@using)),
CrossLanguageTests.cs (1)
34var tree = Parse(text);
DocumentationComments\CrefTests.cs (5)
4417var tree1 = Parse(source1, options: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Diagnose).WithLanguageVersion(LanguageVersion.Latest)); 4418var tree2 = Parse(source2, options: TestOptions.Regular.WithDocumentationMode(DocumentationMode.None).WithLanguageVersion(LanguageVersion.Latest)); 5122var tree = Parse(source, options: TestOptions.RegularWithDocumentationComments); 5228SyntaxTree tree = Parse(source, options: TestOptions.RegularWithDocumentationComments); 5873new[] { Parse(source, options: TestOptions.RegularWithDocumentationComments) },
DocumentationComments\DocumentationCommentCompilerTests.cs (11)
2354var revisedSource = new DocumentationCommentAdder().Visit(Parse(source).GetCompilationUnitRoot()).ToFullString(); 2538var revisedSource = new DocumentationCommentAdder().Visit(Parse(source).GetCompilationUnitRoot()).ToFullString(); 2907var revisedSource = new DocumentationCommentAdder().Visit(Parse(source).GetCompilationUnitRoot()).ToFullString(); 3162var tree1 = Parse(source1, options: TestOptions.RegularWithDocumentationComments); 3163var tree2 = Parse(source2, options: TestOptions.RegularWithDocumentationComments); 3658var tree = Parse(source, options: TestOptions.RegularWithDocumentationComments); 4520var tree = Parse(source, options: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)); 5758var tree = Parse(source, options: TestOptions.RegularWithDocumentationComments); 6010SyntaxTree tree = Parse(source, options: TestOptions.RegularWithDocumentationComments); 7115var tree = Parse(source, options: TestOptions.RegularWithDocumentationComments); 7356Parse(source, options: TestOptions.RegularWithDocumentationComments, filename: sourcePath),
DocumentationComments\DocumentationModeTests.cs (2)
352Parse(string.Format(sourceTemplate, xml, mode), string.Format("{0}.cs", mode), GetOptions(mode))); 381Parse(string.Format(sourceTemplate, includeElement, mode), string.Format("{0}.cs", mode), GetOptions(mode)));
DocumentationComments\PartialTypeDocumentationCommentTests.cs (2)
23var tree1 = Parse( 37var tree2 = Parse(
Symbols\AnonymousTypesSymbolTests.cs (3)
1706private static readonly SyntaxTree s_equalityComparerSourceTree = Parse(@" 1757var comp = CreateEmptyCompilation(new[] { Parse(source), s_equalityComparerSourceTree }, new[] { MinCorlibRef }); 1811var comp = CreateEmptyCompilation(new[] { Parse(source), s_equalityComparerSourceTree }, new[] { MinCorlibRef, attributeLib.ToMetadataReference() });
Symbols\CompilationCreationTests.cs (1)
2783new[] { Parse(source, options: TestOptions.Script) },
Symbols\ConversionTests.cs (1)
227var compilation = CSharpCompilation.Create("Test", new[] { Parse(code) }, new[] { mscorlibRef });
Symbols\CorLibrary\CorTypes.cs (1)
187var c1 = CSharpCompilation.Create("CorLib", syntaxTrees: new[] { Parse(source) });
Symbols\IndexerTests.cs (7)
1285var tree = Parse(source); 2230var tree = Parse(source); 2271var tree = Parse(source); 2313var tree = Parse(source); 2351var tree = Parse(source); 2609var tree = Parse(source); 2696var tree = Parse(source);
Symbols\Metadata\PE\NoPia.cs (6)
370var localTypes1 = CSharpCompilation.Create("LocalTypes1", new[] { Parse(localTypes1Source) }, new[] { pia1CopyLink, mscorlibRef }); 374var localTypes2 = CSharpCompilation.Create("LocalTypes2", new[] { Parse(localTypes2Source) }, new[] { mscorlibRef, pia1CopyLink }); 1009var varC_LocalTypes3 = CSharpCompilation.Create("LocalTypes3", new[] { Parse(localTypes3Source) }, new[] { mscorlibRef, pia1CopyLink }); 1106var varC_Pia5 = CSharpCompilation.Create("Pia5", new[] { Parse(pia5Source) }, new[] { mscorlibRef }); 1114var varC_Pia1 = CSharpCompilation.Create("Pia1", new[] { Parse(pia1Source) }, new[] { mscorlibRef }); 1122var varC_Library2 = CSharpCompilation.Create("Library2", new[] { Parse(library2Source) }, new MetadataReference[] { mscorlibRef, pia1Ref, pia5Ref });
Symbols\OverriddenOrHiddenMembersTests.cs (2)
73var tree = Parse(text); 160var tree = Parse(text);
Symbols\Retargeting\RetargetCustomAttributes.cs (1)
69var compilation1 = CSharpCompilation.Create("C1", new[] { Parse(source) }, new[] { OldMsCorLib }, TestOptions.ReleaseDll);
Symbols\Retargeting\RetargetCustomModifiers.cs (1)
147CSharpCompilation c1 = CSharpCompilation.Create("C1", new[] { Parse(source) }, new[] { oldMsCorLib });
Symbols\Source\AccessTests.cs (7)
27var tree = Parse(text); 44var tree = Parse(text); 70var tree = Parse(text); 93var tree = Parse(text); 122var tree = Parse(text); 144var tree = Parse(text); 167var tree = Parse(text);
Symbols\Source\BaseClassTests.cs (6)
1408var tree = Parse(text); 1424var tree = Parse(text); 1439var comp = CreateCompilation(Parse(text)); 1464var comp = CreateCompilation(Parse(text)); 1495var comp = CreateCompilation(Parse(text)); 1872var comp = CreateCompilation(Parse(text));
Symbols\Source\DeclaringSyntaxNodeTests.cs (12)
257var tree = Parse(text); 300var tree = Parse(text); 602var tree = Parse(text); 637var tree = Parse(text); 662var tree = Parse(text); 688var tree = Parse(text); 717var tree = Parse(text); 732var source0 = Parse("namespace N { partial class C { } } namespace N0 { } class C0 { }"); 733var source1 = Parse("namespace N { partial class C { } } namespace N1 { } class C1 { }"); 734var source2 = Parse("namespace N { struct S { } }"); 735var source3 = Parse("namespace N { partial class C { } } namespace N3 { } class C3 { }"); 745var source4 = Parse("namespace N { partial class C { } } namespace N4 { } class C4 { }");
Symbols\Source\DelegateTests.cs (2)
55source: new[] { Parse(source) }, 227var comp = CreateCompilation(Parse(text));
Symbols\Source\EventTests.cs (1)
58var comp = CreateCompilation(Parse(text));
Symbols\Source\ExternAliasTests.cs (1)
349var tree = Parse(text);
Symbols\Source\FieldTests.cs (2)
234var comp = CreateCompilation(Parse(text)); 254var comp = CreateCompilation(Parse(text));
Symbols\Source\MethodTests.cs (5)
1617var comp = CreateCompilation(Parse(text)); 1662var comp = CreateCompilation(Parse(text)); 1705var comp = CreateCompilation(Parse(text)); 1801var comp = CreateCompilation(Parse(text)); 1854var comp = CreateCompilation(Parse(text));
Symbols\Source\PropertyTests.cs (6)
448var comp = CreateCompilation(Parse(text)); 1653var comp = CreateCompilation(Parse(text)); 1690var comp = CreateCompilation(Parse(text)); 1725var comp = CreateCompilation(Parse(text)); 1745var comp = CreateCompilation(Parse(text)); 1816var comp = CreateCompilation(Parse(text));
Symbols\Source\TypeMapTests.cs (1)
110var tree = Parse(text);
Symbols\Source\UsingAliasTests.cs (22)
30var tree = Parse(text); 87var tree = Parse(text); 147var tree = Parse(text); 202var tree = Parse(text); 267var tree = Parse(text); 294var tree = Parse(text); 340var tree = Parse(text); 381var tree = Parse(text); 402var tree = Parse(text); 421var tree = Parse(text); 440var tree = Parse(text); 459var tree = Parse(text); 478var tree = Parse(text); 499var tree = Parse(text); 521SyntaxTree syntaxTree = Parse(text); 542SyntaxTree syntaxTree = Parse(text); 562SyntaxTree syntaxTree = Parse(text); 581SyntaxTree syntaxTree = Parse(text); 601SyntaxTree syntaxTree = Parse(text); 625SyntaxTree syntaxTree = Parse(text); 648SyntaxTree syntaxTree = Parse(text); 665SyntaxTree syntaxTree = Parse(text);
Symbols\SymbolDistinguisherTests.cs (24)
31var tree = Parse(source, "file.cs"); 77var libRef = new CSharpCompilationReference(CreateCompilation(Parse(source, "file1.cs"), assemblyName: "Metadata")); 78var comp = CreateCompilation(Parse(source, "file2.cs"), new[] { libRef }, assemblyName: "Source"); 95var tree = Parse(source, "file.cs"); 115var tree = Parse(source, "file.cs"); 135var tree = Parse(source, @"a\..\file.cs"); 180var tree = Parse(source, "file.cs"); 206var tree = Parse(source, "file.cs"); 231var tree = Parse(source, "file.cs"); 256var tree = Parse(source, "file.cs"); 278var tree = Parse(source, "file.cs"); 351CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics( 385CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics( 419CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics( 451CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics( 483CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics( 512CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics( 547CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics( 579var libRef = new CSharpCompilationReference(CreateCompilation(Parse(libSource, "file.cs"), assemblyName: "Metadata")); 580CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics( 612CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics( 649CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics( 680CreateCompilation(Parse(source, "file.cs"), new[] { libRef }, assemblyName: "Source").VerifyDiagnostics( 782var comp1 = CreateCompilation(Parse(source1), new[] { ref0 });
Symbols\SymbolErrorTests.cs (9)
2114var tree = Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 2541var comp = CreateCompilation(Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5))); 5516comp = CreateCompilation(new SyntaxTree[] { Parse(text, "goo.cs") }, new List<MetadataReference> { ref1 }); 16853CreateCompilationWithMscorlib461(new[] { Parse(text, options: TestOptions.Script) }).VerifyDiagnostics(expectedDiagnostics); 17740var tree = Parse(sourceLib, filename: @"C:\lib.cs"); 17821var tree = Parse(sourceLib, filename: @"C:\lib.cs"); 17856CreateCompilation(new SyntaxTree[] { Parse(text, "goo.cs") }).VerifyDiagnostics( 17886CreateCompilation(new SyntaxTree[] { Parse(text, "goo.cs") }).VerifyDiagnostics( 17945Parse(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));
Symbols\TypeResolutionTests.cs (1)
51syntaxTrees: new[] { Parse(source1) },
Symbols\TypeTests.cs (6)
816new[] { Parse(mainSrc, options: TestOptions.Script) }, 829new[] { Parse(mainSrc, options: TestOptions.Script) }, 1138var tree = Parse(text); 1152var tree = Parse(text); 1177var tree = Parse(text); 1196var tree = Parse(text);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (7)
Diagnostics\DiagnosticTest.cs (1)
2483var tree = Parse(text);
Parsing\ParserErrorMessageTests.cs (3)
5697tree = Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6519var parsedTree = Parse(builder.ToString()); 6552var parsedTree = Parse(builder.ToString());
Parsing\PatternParsingTests.cs (2)
2989Parse(source, options: TestOptions.RegularWithRecursivePatterns); 2995Parse(source2, options: TestOptions.RegularWithRecursivePatterns);
Syntax\SyntaxRewriterTests.cs (1)
649var oldTree = CSharpTestBase.Parse(oldSource, options: TestOptions.RegularWithDocumentationComments);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
CSharpTestBase.cs (4)
1101return sources.Select((src, index) => Parse(src, filename: $"{index}.cs", options: options)).ToArray(); 1106var tree = Parse(text, options: options ?? TestOptions.RegularPreview); 1466syntaxTree: Parse(source, options: parseOptions ?? TestOptions.Script), 1489syntaxTree: Parse(code, options: parseOptions ?? TestOptions.Script),
CSharpTestSource.cs (1)
57return new[] { CSharpTestBase.Parse(source, fileName, parseOptions) };
Microsoft.CodeAnalysis.Rebuild.UnitTests (3)
CSharpDeterministicKeyBuilderTests.cs (3)
28CSharpTestBase.Parse( 152var source = CSharpTestBase.Parse( 188var syntaxTree = CSharpTestBase.Parse(