1 instantiation of TestWorkspace
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace_Create.cs (1)
34
var workspace = new
TestWorkspace
(composition, workspaceKind, ignoreUnchangeableDocumentsWhenApplyingChanges: ignoreUnchangeableDocumentsWhenApplyingChanges);
732 references to TestWorkspace
IdeBenchmarks (10)
FormatterBenchmarks.cs (4)
46
using
var
workspace =
TestWorkspace
.CreateCSharp(text);
59
using
var
workspace =
TestWorkspace
.CreateVisualBasic(text);
InheritanceMargin\InheritanceMarginGlyphBenchmarks.cs (2)
129
using
var
workspace =
TestWorkspace
.CreateCSharp(testFile);
RegexClassifierBenchmarks.cs (2)
71
using (
var
workspace =
TestWorkspace
.CreateCSharp(code, parseOptions))
SQLitePersistentStorageBenchmark.cs (2)
30
private
TestWorkspace
_workspace;
55
_workspace =
TestWorkspace
.Create(
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (7)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
2883
using
var
workspace = CreateWorkspaceFromOptions(input, parameters);
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedParametersTests.cs (1)
1227
using
var
workspace = CreateWorkspaceFromOptions(source, testParameters);
src\Analyzers\CSharp\Tests\SimplifyInterpolation\SimplifyInterpolationTests.cs (1)
34
using
var
workspace = CreateWorkspaceFromOptions("""
src\Analyzers\CSharp\Tests\UpdateProjectToAllowUnsafe\UpdateProjectToAllowUnsafeTests.cs (1)
33
using (
var
workspace = CreateWorkspaceFromOptions(initialMarkup, parameters))
src\Analyzers\CSharp\Tests\UpgradeProject\UpgradeProjectTests.cs (2)
38
using (
var
workspace = CreateWorkspaceFromOptions(initialMarkup, parameters))
60
using
var
workspace = CreateWorkspaceFromOptions(initialMarkup, parameters);
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
659
using
var
workspace = CreateWorkspaceFromOptions(source, testParameters);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (13)
Completion\CompletionProviders\LoadDirectiveCompletionProviderTests.cs (1)
84
using
var
workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features);
Completion\CompletionProviders\ReferenceDirectiveCompletionProviderTests.cs (1)
125
using
var
workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features);
Completion\CompletionServiceTests.cs (2)
48
using
var
workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features.AddParts(typeof(ThirdPartyCompletionProvider)));
105
using
var
workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features.AddParts(typeof(ThirdPartyCompletionProvider)));
Rename\CSharpInlineRenameServiceTests.cs (2)
62
using
var
workspace =
TestWorkspace
.CreateCSharp(markup, composition: EditorTestCompositions.EditorFeatures);
StringIndentation\StringIndentationTests.cs (3)
26
using
var
workspace =
TestWorkspace
.CreateWorkspace(
27
TestWorkspace
.CreateWorkspaceElement(LanguageNames.CSharp,
SymbolKey\SymbolKeyTests.cs (4)
193
using
var
workspace = GetWorkspace();
210
TestWorkspace
GetWorkspace()
236
return
TestWorkspace
.CreateWorkspace(XElement.Parse($@"
245
return
TestWorkspace
.CreateWorkspace(XElement.Parse($@"
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
58
using
var
workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (100)
AddAwait\AddAwaitTests.cs (1)
18
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
AddFileBanner\AddFileBannerTests.cs (1)
18
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertAnonymousType\ConvertAnonymousTypeToClassTests.cs (1)
22
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertAnonymousType\ConvertAnonymousTypeToTupleTests.cs (1)
20
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertAutoPropertyToFullProperty\ConvertAutoPropertyToFullPropertyTests.cs (5)
18
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
1223
using
var
testWorkspace =
TestWorkspace
.Create(xmlString);
1270
using
var
testWorkspace =
TestWorkspace
.Create(xmlString);
ConvertBetweenRegularAndVerbatimString\ConvertBetweenRegularAndVerbatimInterpolatedStringTests.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertBetweenRegularAndVerbatimString\ConvertBetweenRegularAndVerbatimStringTests.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertForEachToFor\ConvertForEachToForTests.cs (1)
24
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertForToForEach\ConvertForToForEachTests.cs (1)
22
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertIfToSwitch\ConvertIfToSwitchFixAllTests.cs (1)
17
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertLinq\ConvertForEachToLinqQueryTests.cs (1)
18
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertLinq\ConvertLinqQueryToForEachTests.cs (1)
20
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertLocalFunctionToMethod\ConvertLocalFunctionToMethodTests.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertNamespace\ConvertNamespaceRefactoringFixAllTests.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertNumericLiteral\ConvertNumericLiteralTests.cs (1)
20
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertToInterpolatedString\ConvertPlaceholderToInterpolatedStringTests.cs (1)
20
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringTests.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertToRawString\ConvertInterpolatedStringToRawString_FixAllTests.cs (1)
18
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ConvertToRawString\ConvertRegularStringToRawString_FixAllTests.cs (1)
18
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (1)
1058
using
var
workspace = CreateWorkspaceFromOptions(source, parameters);
Diagnostics\Suppression\SuppressionAllCodeTests.cs (2)
27
protected override
TestWorkspace
CreateWorkspaceFromFile(string definition, ParseOptions parseOptions)
28
=>
TestWorkspace
.CreateCSharp(definition, (CSharpParseOptions)parseOptions, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService);
Diagnostics\Suppression\SuppressionTests.cs (3)
444
using
var
workspace = CreateWorkspaceFromOptions(source, parameters);
756
protected override async Task<(ImmutableArray<CodeAction>, CodeAction actionToInvoke)> GetCodeActionsAsync(
TestWorkspace
workspace, TestParameters parameters)
998
protected override async Task<(ImmutableArray<CodeAction>, CodeAction actionToInvoke)> GetCodeActionsAsync(
TestWorkspace
workspace, TestParameters parameters)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (15)
36
private static
TestWorkspace
CreateWorkspace()
300
using
var
workspace = CreateWorkspace();
367
using
var
workspace = CreateWorkspace();
394
using
var
workspace = CreateWorkspace();
428
using
var
workspace = CreateWorkspace();
459
using
var
workspace = CreateWorkspace();
508
using
var
workspace =
TestWorkspace
.CreateCSharp(
541
using
var
workspace = CreateWorkspace();
579
using
var
workspace = CreateWorkspace();
618
using
var
workspace = CreateWorkspace();
659
using
var
workspace = CreateWorkspace();
706
using
var
workspace = CreateWorkspace();
740
using
var
workspace = CreateWorkspace();
794
using
var
workspace = CreateWorkspace();
EnableNullable\EnableNullableFixAllTests.cs (1)
16
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
EncapsulateField\EncapsulateFieldTests.cs (1)
24
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ExtractClass\ExtractClassTests.cs (1)
52
return Task.FromResult<Workspace>(
TestWorkspace
.Create(WorkspaceKind, LanguageNames.CSharp, unusedCompilationOptions, unusedParseOptions));
ExtractMethod\ExtractLocalFunctionTests.cs (1)
22
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ExtractMethod\ExtractMethodTests2.cs (1)
23
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
GenerateOverrides\GenerateOverridesTests.cs (1)
20
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
InlineTemporary\InlineTemporaryTests.cs (1)
20
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
IntroduceParameter\IntroduceParameterTests.cs (1)
22
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
IntroduceUsingStatement\IntroduceUsingStatementTests.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
IntroduceVariable\InteractiveIntroduceVariableTests.cs (1)
20
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
IntroduceVariable\IntroduceLocalForExpressionTests.cs (1)
56
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
IntroduceVariable\IntroduceVariableTests.cs (1)
25
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
InvertConditional\InvertConditionalTests.cs (1)
20
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
InvertLogical\InvertLogicalTests.cs (1)
23
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
MakeLocalFunctionStatic\MakeLocalFunctionStaticRefactoringTests.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
MoveDeclarationNearReference\MoveDeclarationNearReferenceTests.cs (1)
21
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
NameTupleElement\NameTupleElementTests.cs (1)
20
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ReplaceDocCommentTextWithTag\ReplaceDocCommentTextWithTagTests.cs (1)
18
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyTests.cs (1)
20
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ReplacePropertyWithMethods\ReplacePropertyWithMethodsTests.cs (1)
23
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
ReverseForStatement\ReverseForStatementTests.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
SemanticSearch\CSharpSemanticSearchServiceTests.cs (8)
48
using
var
workspace =
TestWorkspace
.Create("""
89
using
var
workspace =
TestWorkspace
.Create("""
139
using
var
workspace =
TestWorkspace
.Create("""
193
using
var
workspace =
TestWorkspace
.Create("""
SplitOrMergeIfStatements\MergeConsecutiveIfStatementsTests_ElseIf_WithPrevious.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
SplitOrMergeIfStatements\MergeNestedIfStatementsTests_WithOuter.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
SplitOrMergeIfStatements\SplitIntoConsecutiveIfStatementsTests.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
SplitOrMergeIfStatements\SplitIntoNestedIfStatementsTests.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
2883
using
var
workspace = CreateWorkspaceFromOptions(input, parameters);
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedParametersTests.cs (1)
1227
using
var
workspace = CreateWorkspaceFromOptions(source, testParameters);
src\Analyzers\CSharp\Tests\SimplifyInterpolation\SimplifyInterpolationTests.cs (1)
34
using
var
workspace = CreateWorkspaceFromOptions("""
src\Analyzers\CSharp\Tests\UpdateProjectToAllowUnsafe\UpdateProjectToAllowUnsafeTests.cs (1)
33
using (
var
workspace = CreateWorkspaceFromOptions(initialMarkup, parameters))
src\Analyzers\CSharp\Tests\UpgradeProject\UpgradeProjectTests.cs (2)
38
using (
var
workspace = CreateWorkspaceFromOptions(initialMarkup, parameters))
60
using
var
workspace = CreateWorkspaceFromOptions(initialMarkup, parameters);
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
659
using
var
workspace = CreateWorkspaceFromOptions(source, testParameters);
Testing\CSharpTestMethodFinderTests.cs (2)
552
var workspace =
TestWorkspace
.CreateCSharp([code, testAttributeDefinitionsCode]);
566
var workspace =
TestWorkspace
.CreateCSharp([code, testAttributeDefinitionsCode]);
UseExplicitOrImplicitType\UseExplicitTypeRefactoringTests.cs (1)
18
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
UseExplicitOrImplicitType\UseImplicitTypeRefactoringTests.cs (1)
20
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
UseExpressionBody\Refactoring\UseExpressionBodyFixAllTests.cs (1)
19
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
UseExpressionBody\Refactoring\UseExpressionBodyForAccessorsRefactoringTests.cs (1)
23
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
UseExpressionBody\Refactoring\UseExpressionBodyForConstructorsRefactoringTests.cs (1)
22
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
UseExpressionBody\Refactoring\UseExpressionBodyForConversionOperatorsRefactoringTests.cs (1)
22
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
UseExpressionBody\Refactoring\UseExpressionBodyForIndexersRefactoringTests.cs (1)
23
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
UseExpressionBody\Refactoring\UseExpressionBodyForLocalFunctionsRefactoringTests.cs (1)
22
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
UseExpressionBody\Refactoring\UseExpressionBodyForMethodsRefactoringTests.cs (1)
21
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
UseExpressionBody\Refactoring\UseExpressionBodyForOperatorsRefactoringTests.cs (1)
22
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
UseExpressionBody\Refactoring\UseExpressionBodyForPropertiesRefactoringTests.cs (1)
24
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
UseExpressionBodyForLambda\UseExpressionBodyForLambdasRefactoringTests.cs (1)
22
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
UseRecursivePatterns\UseRecursivePatternsRefactoringFixAllTests.cs (1)
17
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
Wrapping\AbstractWrappingTests.cs (1)
20
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(
TestWorkspace
workspace, TestParameters parameters)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (15)
AutomaticCompletion\AbstractAutomaticLineEnderTests.cs (2)
114
public static T GetService<T>(
TestWorkspace
workspace)
117
public static T GetExportedValue<T>(
TestWorkspace
workspace)
Completion\AbstractCompletionProviderTests.cs (4)
810
using
var
testWorkspace =
TestWorkspace
.Create(xmlString, composition: GetComposition());
866
using
var
testWorkspace =
TestWorkspace
.Create(xmlString, composition: GetComposition());
GoToAdjacentMember\AbstractGoToAdjacentMemberTests.cs (4)
32
using
var
workspace =
TestWorkspace
.Create(
56
using
var
workspace =
TestWorkspace
.Create(
LanguageServer\AbstractLanguageServerProtocolTests.cs (1)
323
TestWorkspace
.CreateWorkspaceElement(languageName, files: markups, fileContainingFolders: lspOptions.DocumentFileContainingFolders, sourceGeneratedFiles: lspOptions.SourceGeneratedMarkups, commonReferences: commonReferences),
Structure\AbstractSyntaxStructureProviderTests.cs (4)
43
using
var
workspace =
TestWorkspace
.Create(WorkspaceKind, LanguageName, compilationOptions: null, parseOptions: null, content: markupCode);
64
using
var
workspace =
TestWorkspace
.Create(WorkspaceKind, LanguageName, compilationOptions: null, parseOptions: null, content: markupCode);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (327)
CodeFixes\CodeFixServiceTests.cs (4)
44
using
var
workspace =
TestWorkspace
.CreateCSharp(code, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService, openDocuments: true);
768
using
var
workspace =
TestWorkspace
.CreateCSharp(code, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService, openDocuments: true);
CodeGeneration\CodeGenerationTests.cs (7)
435
var
workspace = testContext.Workspace;
849
public readonly
TestWorkspace
Workspace;
857
TestWorkspace
workspace,
875
var
workspace = CreateWorkspaceFromFile(initial.NormalizeLineEndings(), isVisualBasic, null, null);
990
private static
TestWorkspace
CreateWorkspaceFromFile(string file, bool isVisualBasic, ParseOptions parseOptions, CompilationOptions compilationOptions)
993
?
TestWorkspace
.CreateVisualBasic(file, (VB.VisualBasicParseOptions)parseOptions, (VB.VisualBasicCompilationOptions)compilationOptions)
994
:
TestWorkspace
.CreateCSharp(file, (CS.CSharpParseOptions)parseOptions, (CS.CSharpCompilationOptions)compilationOptions);
CodeRefactorings\CodeRefactoringServiceTest.cs (10)
44
using
var
workspace =
TestWorkspace
.CreateCSharp(code, composition: FeaturesTestCompositions.Features);
78
using
var
workspace =
TestWorkspace
.Create(@"
95
using
var
workspace =
TestWorkspace
.CreateCSharp(@"class Program {}",
157
using
var
workspace =
TestWorkspace
.CreateCSharp("", composition: FeaturesTestCompositions.Features);
196
using
var
workspace =
TestWorkspace
.CreateCSharp("", composition: FeaturesTestCompositions.Features);
Completion\CompletionServiceTests.cs (2)
39
using
var
workspace =
TestWorkspace
.CreateCSharp(code, openDocuments: true);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (7)
622
workspace.InitializeDocuments(
TestWorkspace
.CreateWorkspaceElement(LanguageNames.CSharp, files: files, sourceGeneratedFiles: sourceGeneratedFiles), openDocuments: false);
694
using
var
workspace =
TestWorkspace
.CreateCSharp("class A { }");
739
using
var
workspace =
TestWorkspace
.CreateCSharp(source);
812
using
var
workspace =
TestWorkspace
.CreateCSharp(source);
Diagnostics\DiagnosticDataTests.cs (5)
111
using
var
workspace = new TestWorkspace(composition: EditorTestCompositions.EditorFeatures);
137
using
var
workspace = new TestWorkspace(composition: EditorTestCompositions.EditorFeatures);
181
using
var
workspace =
TestWorkspace
.CreateCSharp(files: [], sourceGeneratedFiles: [content], composition: EditorTestCompositions.EditorFeatures);
221
using
var
workspace = new TestWorkspace(composition: EditorTestCompositions.EditorFeatures);
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (2)
110
using
var
workspace = new TestWorkspace();
699
using
var
workspace = new TestWorkspace();
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (4)
56
using
var
workspace = CreateWorkspaceFromFile(source, language, rootNamespace);
73
private static
TestWorkspace
CreateWorkspaceFromFile(string source, string language, string rootNamespace)
77
return
TestWorkspace
.CreateCSharp(source, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService);
81
return
TestWorkspace
.CreateVisualBasic(
EditAndContinue\EditAndContinueLanguageServiceTests.cs (4)
46
private
TestWorkspace
CreateEditorWorkspace(out Solution solution, out EditAndContinueService service, out EditAndContinueLanguageService languageService, Type[] additionalParts = null)
55
var
workspace = new TestWorkspace(composition: composition, solutionTelemetryId: s_solutionTelemetryId);
98
using
var
localWorkspace = new TestWorkspace(composition: localComposition);
238
using
var
workspace = CreateEditorWorkspace(out var solution, out var service, out var languageService);
FindSymbols\SymbolTreeInfoTests.cs (8)
20
using
var
workspace =
TestWorkspace
.CreateCSharp("");
41
using
var
workspace =
TestWorkspace
.CreateCSharp("");
64
using
var
workspace =
TestWorkspace
.CreateCSharp("");
86
using
var
workspace =
TestWorkspace
.CreateCSharp("");
InheritanceMargin\InheritanceMarginTests.cs (9)
54
using
var
testWorkspace =
TestWorkspace
.Create(
83
using
var
testWorkspace =
TestWorkspace
.Create(
92
TestWorkspace
testWorkspace,
124
private static async Task VerifyInheritanceMemberAsync(
TestWorkspace
testWorkspace, TestInheritanceMemberItem expectedItem, InheritanceMarginItem actualItem)
207
using
var
testWorkspace =
TestWorkspace
.Create(
307
TestWorkspace
testWorkspace)
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (5)
35
public readonly
TestWorkspace
Workspace;
54
var
workspace = CreateWorkspace(
69
public TestContext(
TestWorkspace
workspace)
244
private static
TestWorkspace
CreateWorkspace(
295
return
TestWorkspace
.Create(xmlString, composition: composition);
Options\GlobalOptionsTests.cs (3)
150
private static
TestWorkspace
CreateWorkspace(out TestGlobalOptions globalOptions)
156
var
workspace = new TestWorkspace(composition: composition);
184
using
var
workspace = CreateWorkspace(out var globalOptions);
Snippets\RoslynLSPSnippetConvertTests.cs (5)
401
using
var
workspace = CreateWorkspaceFromCode(testString);
412
using
var
workspace = CreateWorkspaceFromCode(testString);
485
protected static
TestWorkspace
CreateWorkspaceFromCode(string code)
486
=>
TestWorkspace
.CreateCSharp(code);
494
using
var
workspace = CreateWorkspaceFromCode(markup);
StackTraceExplorer\StackTraceExplorerTests.cs (6)
24
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
815
using
var
workspace =
TestWorkspace
.CreateCSharp(@"
848
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
Structure\BlockStructureServiceTests.cs (9)
39
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
63
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
87
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
104
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
113
TestWorkspace
workspace)
SymbolFinder\DependentTypeFinderTests.cs (21)
43
private static
TestWorkspace
CreateWorkspace(TestHost host)
46
return
TestWorkspace
.CreateWorkspace(XElement.Parse("<Workspace></Workspace>"), composition: composition);
52
using
var
workspace = CreateWorkspace(host);
93
using
var
workspace = CreateWorkspace(host);
140
using
var
workspace = CreateWorkspace(host);
185
using
var
workspace = CreateWorkspace(host);
226
using
var
workspace = CreateWorkspace(host);
268
using
var
workspace = CreateWorkspace(host);
310
using
var
workspace = CreateWorkspace(host);
350
using
var
workspace = CreateWorkspace(host);
391
using
var
workspace = CreateWorkspace(host);
431
using
var
workspace = CreateWorkspace(host);
462
using
var
workspace = CreateWorkspace(host);
511
using
var
workspace = CreateWorkspace(host);
563
using
var
workspace = CreateWorkspace(host);
590
using
var
workspace = CreateWorkspace(host);
623
using
var
workspace =
TestWorkspace
.Create(
663
using
var
workspace = CreateWorkspace(host);
727
using
var
workspace = CreateWorkspace(host);
770
using
var
workspace = CreateWorkspace(host);
SymbolFinder\FindSymbolAtPositionTests.cs (5)
18
private static Task<ISymbol> FindSymbolAtPositionAsync(
TestWorkspace
workspace)
28
using
var
workspace =
TestWorkspace
.CreateCSharp(
46
using
var
workspace =
TestWorkspace
.CreateCSharp(
SymbolKey\SymbolKeyCrossLanguageTests.cs (2)
24
using
var
workspace =
TestWorkspace
.Create(
Utilities\SymbolEquivalenceComparerTests.cs (170)
51
using
var
workspace =
TestWorkspace
.CreateCSharp(csharpCode);
122
using
var
csharpWorkspace =
TestWorkspace
.CreateCSharp(csharpCode);
123
using
var
vbWorkspace =
TestWorkspace
.CreateVisualBasic(vbCode);
192
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
193
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
243
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
244
using
var
workspace2 =
TestWorkspace
.CreateVisualBasic(vbCode1);
283
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
326
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
327
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
351
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
352
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
376
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
377
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
401
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
402
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
426
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
427
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
453
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
454
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
480
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
481
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
507
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
508
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
532
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
533
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
557
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
558
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
584
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
585
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
618
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
619
using
var
workspace2 =
TestWorkspace
.CreateVisualBasic(vbCode1);
663
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
664
using
var
workspace2 =
TestWorkspace
.CreateVisualBasic(vbCode1);
695
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
720
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
721
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
755
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
756
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
788
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
789
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
823
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
824
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
854
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
855
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode1);
931
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
932
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
968
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
969
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
993
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
994
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1018
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1019
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1049
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1050
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1079
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1080
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1110
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1111
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1150
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1151
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1180
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1181
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1210
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1211
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1241
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1242
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1272
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1273
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1304
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1305
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1341
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1342
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1405
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1406
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1468
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1469
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1531
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode1);
1532
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode2);
1619
using
var
workspace1 =
TestWorkspace
.CreateCSharp(code);
1620
using
var
workspace2 =
TestWorkspace
.CreateCSharp(code);
1693
using
var
workspace1 =
TestWorkspace
.CreateVisualBasic(code);
1694
using
var
workspace2 =
TestWorkspace
.CreateVisualBasic(code);
1716
using
var
workspace1 =
TestWorkspace
.CreateCSharp(csharpCode, compilationOptions: new CS.CSharpCompilationOptions(OutputKind.NetModule, moduleName: "GooModule"));
1717
using
var
workspace2 =
TestWorkspace
.CreateCSharp(csharpCode, compilationOptions: new CS.CSharpCompilationOptions(OutputKind.NetModule, moduleName: "BarModule"));
ValueTracking\AbstractBaseValueTrackingTests.cs (8)
21
protected
TestWorkspace
CreateWorkspace(string code, TestHost testHost)
24
protected abstract
TestWorkspace
CreateWorkspace(string code, TestComposition composition);
26
internal static async Task<ImmutableArray<ValueTrackedItem>> GetTrackedItemsAsync(
TestWorkspace
testWorkspace, CancellationToken cancellationToken = default)
36
internal static async Task<ImmutableArray<ValueTrackedItem>> GetTrackedItemsAsync(
TestWorkspace
testWorkspace, ValueTrackedItem item, CancellationToken cancellationToken = default)
42
internal static async Task<ImmutableArray<ValueTrackedItem>> ValidateItemsAsync(
TestWorkspace
testWorkspace, (int line, string text)[] itemInfo, CancellationToken cancellationToken = default)
55
internal static async Task<ImmutableArray<ValueTrackedItem>> ValidateChildrenAsync(
TestWorkspace
testWorkspace, ValueTrackedItem item, (int line, string text)[] childInfo, CancellationToken cancellationToken = default)
68
internal static async Task ValidateChildrenEmptyAsync(
TestWorkspace
testWorkspace, ValueTrackedItem item, CancellationToken cancellationToken = default)
74
internal static async Task ValidateChildrenEmptyAsync(
TestWorkspace
testWorkspace, IEnumerable<ValueTrackedItem> items, CancellationToken cancellationToken = default)
ValueTracking\CSharpValueTrackingTests.cs (21)
16
protected override
TestWorkspace
CreateWorkspace(string code, TestComposition composition)
17
=>
TestWorkspace
.CreateCSharp(code, composition: composition);
36
using
var
workspace = CreateWorkspace(code, testHost);
69
using
var
workspace = CreateWorkspace(code, testHost);
101
using
var
workspace = CreateWorkspace(code, testHost);
134
using
var
workspace = CreateWorkspace(code, testHost);
165
using
var
workspace = CreateWorkspace(code, testHost);
191
using
var
workspace = CreateWorkspace(code, testHost);
217
using
var
workspace = CreateWorkspace(code, testHost);
235
using
var
workspace = CreateWorkspace(code, testHost);
256
using
var
workspace = CreateWorkspace(code, testHost);
306
using
var
workspace = CreateWorkspace(code, testHost);
432
using
var
workspace = CreateWorkspace(code, testHost);
572
using
var
workspace = CreateWorkspace(code, testHost);
650
using
var
workspace = CreateWorkspace(code, testHost);
709
using
var
workspace = CreateWorkspace(code, testHost);
771
using
var
workspace = CreateWorkspace(code, testHost);
837
using
var
workspace = CreateWorkspace(code, testHost);
906
using
var
workspace = CreateWorkspace(code, testHost);
968
using
var
workspace = CreateWorkspace(code, testHost);
1018
using
var
workspace = CreateWorkspace(code, testHost);
ValueTracking\VisualBasicValueTrackingTests.cs (10)
16
protected override
TestWorkspace
CreateWorkspace(string code, TestComposition composition)
17
=>
TestWorkspace
.CreateVisualBasic(code, composition: composition);
46
using
var
workspace = CreateWorkspace(code, testHost);
90
using
var
workspace = CreateWorkspace(code, testHost);
128
using
var
workspace = CreateWorkspace(code, testHost);
159
using
var
workspace = CreateWorkspace(code, testHost);
185
using
var
workspace = CreateWorkspace(code, testHost);
221
using
var
workspace = CreateWorkspace(code, testHost);
280
using
var
workspace = CreateWorkspace(code, testHost);
341
using
var
workspace = CreateWorkspace(code, testHost);
Microsoft.CodeAnalysis.Features.Test.Utilities (8)
EditAndContinue\ActiveStatementsDescription.cs (1)
145
var documentName = filePaths?[sourceIndex] ?? Path.Combine(TempRoot.Root,
TestWorkspace
.GetDefaultTestSourceDocumentName(sourceIndex, extension ?? ""));
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (3)
54
internal
TestWorkspace
CreateWorkspace(out Solution solution, out EditAndContinueService service, Type[]? additionalParts = null)
60
var
workspace = new TestWorkspace(composition: composition, solutionTelemetryId: s_solutionTelemetryId);
132
internal EditAndContinueService GetEditAndContinueService(
TestWorkspace
workspace)
RelatedDocuments\AbstractRelatedDocumentsTests.cs (2)
24
using
var
workspace =
TestWorkspace
.Create(
Snippets\AbstractSnippetProviderTests.cs (2)
31
using
var
workspace = new TestWorkspace(FeaturesTestCompositions.Features);
114
using
var
workspace = new TestWorkspace(FeaturesTestCompositions.Features);
Microsoft.CodeAnalysis.Features.UnitTests (107)
EditAndContinue\ActiveStatementsMapTests.cs (3)
93
using
var
workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features);
160
using
var
workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features);
201
using
var
workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features);
EditAndContinue\CompileTimeSolutionProviderTests.cs (2)
27
var
workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features);
76
var
workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features);
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (26)
79
using
var
_ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]);
165
using
var
_ = CreateWorkspace(out var solution, out var service);
198
using
var
_ = CreateWorkspace(out var solution, out var service);
232
using
var
_ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]);
279
using
var
_ = CreateWorkspace(out var solution, out var service);
308
using
var
_ = CreateWorkspace(out var solution, out var service);
341
using
var
_ = CreateWorkspace(out var solution, out var service);
392
using
var
_ = CreateWorkspace(out var solution, out var service);
497
using
var
_w = CreateWorkspace(out var solution, out var service);
566
using
var
_ = CreateWorkspace(out var solution, out var service);
617
using
var
_ = CreateWorkspace(out var solution, out var service);
675
using
var
_ = CreateWorkspace(out var solution, out var service);
760
using
var
_ = CreateWorkspace(out var solution, out var service);
812
using
var
_ = CreateWorkspace(out var solution, out var service);
862
using
var
_ = CreateWorkspace(out var solution, out var service);
913
using
var
workspace = CreateWorkspace(out var solution, out var service);
961
using
var
_ = CreateWorkspace(out var solution, out var service);
1028
using
var
_ = CreateWorkspace(out var solution, out var service);
1104
using
var
_ = CreateWorkspace(out var solution, out var service);
1138
using
var
_ = CreateWorkspace(out var solution, out var service);
1239
using
var
_ = CreateWorkspace(out var solution, out var service);
1282
using
var
_ = CreateWorkspace(out var solution, out var service);
1336
using
var
_ = CreateWorkspace(out var solution, out var service);
1376
using
var
_ = CreateWorkspace(out var solution, out var service);
1420
using
var
_ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]);
1495
using
var
_ = CreateWorkspace(out var solution, out var service);
EditAndContinue\EditSessionActiveStatementsTests.cs (5)
64
private static async Task<Solution> AddDefaultTestSolutionAsync(
TestWorkspace
workspace, string[] markedSources)
171
using
var
workspace = new TestWorkspace(composition: s_composition);
334
using
var
workspace = new TestWorkspace(composition: s_composition);
516
using
var
workspace = new TestWorkspace(composition: s_composition);
651
using
var
workspace = new TestWorkspace(composition: s_composition);
EditAndContinue\EmitSolutionUpdateResultsTests.cs (9)
27
private static
TestWorkspace
CreateWorkspace(out Solution solution)
29
var
workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features);
62
using
var
workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features);
156
using
var
_ = CreateWorkspace(out var solution);
179
using
var
_ = CreateWorkspace(out var solution);
205
using
var
_ = CreateWorkspace(out var solution);
228
using
var
_ = CreateWorkspace(out var solution);
255
using
var
_ = CreateWorkspace(out var solution);
282
using
var
_ = CreateWorkspace(out var solution);
EditAndContinue\RemoteEditAndContinueServiceTests.cs (1)
50
using
var
localWorkspace = new TestWorkspace(composition: localComposition);
EditAndContinue\UnitTestingHotReloadServiceTests.cs (1)
35
using
var
workspace = CreateWorkspace(out var solution, out var encService);
EditAndContinue\WatchHotReloadServiceTests.cs (2)
46
using
var
workspace = CreateWorkspace(out var solution, out var encService);
121
using
var
workspace = CreateWorkspace(out var solution, out var encService);
FindUsages\DefinitionItemFactoryTests.cs (58)
128
using
var
workspace =
TestWorkspace
.CreateCSharp("class C;");
164
using
var
workspace =
TestWorkspace
.CreateCSharp("");
206
using
var
workspace =
TestWorkspace
.CreateCSharp("class C;");
242
using
var
workspace =
TestWorkspace
.CreateCSharp("");
284
using
var
workspace =
TestWorkspace
.CreateCSharp("namespace N;");
326
using
var
workspace =
TestWorkspace
.CreateCSharp("");
376
using
var
workspace =
TestWorkspace
.CreateCSharp("""
433
using
var
workspace =
TestWorkspace
.CreateCSharp("namespace N {}");
473
using
var
workspace =
TestWorkspace
.CreateCSharp("namespace N {}");
513
using
var
workspace =
TestWorkspace
.CreateCSharp("class C;");
555
using
var
workspace =
TestWorkspace
.CreateCSharp("");
601
using
var
workspace =
TestWorkspace
.Create("""
659
using
var
workspace =
TestWorkspace
.CreateCSharp("class C { dynamic F; }");
696
using
var
workspace =
TestWorkspace
.CreateCSharp("class C { (int a, int b) F; }");
758
using
var
workspace =
TestWorkspace
.CreateCSharp("class C { System.ValueTuple<int, int> F; }");
814
using
var
workspace =
TestWorkspace
.CreateCSharp("class C<T1, T2> { C<int, string> F; }");
865
using
var
workspace =
TestWorkspace
.CreateCSharp("""
923
using
var
workspace =
TestWorkspace
.CreateCSharp("class C<T>;");
973
using
var
workspace =
TestWorkspace
.CreateCSharp("class C { void M(int x) { } }");
1028
using
var
workspace =
TestWorkspace
.CreateCSharp("class C { int M; }");
1080
using
var
workspace =
TestWorkspace
.CreateCSharp("class C { int P { get; set; } }");
1142
using
var
workspace =
TestWorkspace
.CreateCSharp("class C { int P { get; set; } }");
1199
using
var
workspace =
TestWorkspace
.CreateCSharp("class C { int P { get; set; } }");
1256
using
var
workspace =
TestWorkspace
.CreateCSharp("abstract class C { abstract int this[int x] { get; set; } }");
1323
using
var
workspace =
TestWorkspace
.CreateCSharp("""
1383
using
var
workspace =
TestWorkspace
.CreateCSharp("""
1440
using
var
workspace =
TestWorkspace
.CreateCSharp("class C { void M(int x) { void F() {} } }");
1498
using
var
workspace =
TestWorkspace
.CreateCSharp("""
1561
using
var
workspace =
TestWorkspace
.Create("""
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (4)
Options\SolutionAnalyzerConfigOptionsUpdaterTests.cs (4)
18
private static
TestWorkspace
CreateWorkspace()
20
var
workspace = new TestWorkspace(LspTestCompositions.LanguageServerProtocol
33
using
var
workspace = CreateWorkspace();
101
using
var
workspace = CreateWorkspace();
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (15)
Workspaces\TestHostProject.cs (2)
42
TestWorkspace
workspace,
90
TestWorkspace
workspace,
Workspaces\TestWorkspace_Create.cs (13)
14
public static
TestWorkspace
Create(string xmlDefinition, bool openDocuments = false, TestComposition composition = null)
17
public static
TestWorkspace
CreateWorkspace(
26
internal static
TestWorkspace
Create(
34
var
workspace = new TestWorkspace(composition, workspaceKind, ignoreUnchangeableDocumentsWhenApplyingChanges: ignoreUnchangeableDocumentsWhenApplyingChanges);
43
internal static
TestWorkspace
Create(
56
internal static
TestWorkspace
Create(
67
internal static
TestWorkspace
Create(
77
internal static
TestWorkspace
Create(
96
internal static
TestWorkspace
CreateWithSingleEmptySourceFile(
115
public static
TestWorkspace
CreateCSharp(
127
public static
TestWorkspace
CreateCSharp(
144
public static
TestWorkspace
CreateVisualBasic(
155
public static
TestWorkspace
CreateVisualBasic(
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (8)
DesignerAttribute\DesignerAttributeServiceTests.cs (2)
117
using
var
workspace =
TestWorkspace
.CreateCSharp(codeWithMarker, openDocuments: false);
F1Help\F1HelpTests.cs (2)
27
using
var
workspace =
TestWorkspace
.CreateCSharp(markup, composition: VisualStudioTestCompositions.LanguageServices);
Interactive\Commands\ResetInteractiveTests.cs (4)
49
using
var
workspace =
TestWorkspace
.Create(WorkspaceXmlStr, composition: EditorTestCompositions.InteractiveWindow);
67
TestWorkspace
workspace,
140
private static IEnumerable<string> GetProjectReferences(
TestWorkspace
workspace, Project project)
Microsoft.VisualStudio.LanguageServices.UnitTests (22)
Debugging\VisualBasicBreakpointResolutionServiceTests.vb (1)
27
Using workspace =
TestWorkspace
.CreateVisualBasic(source)
Help\HelpTests.vb (1)
18
Using workspace =
TestWorkspace
.CreateVisualBasic(markup)
Options\BasicEditorConfigGeneratorTests.vb (2)
21
Using workspace =
TestWorkspace
.CreateVisualBasic("")
172
Using workspace =
TestWorkspace
.CreateVisualBasic("")
Options\CSharpEditorConfigGeneratorTests.vb (2)
19
Using workspace =
TestWorkspace
.CreateCSharp("")
275
Using workspace =
TestWorkspace
.CreateCSharp("")
Preview\PreviewChangesTests.vb (2)
23
Using workspace =
TestWorkspace
.CreateCSharp(<text>
123
Using workspace =
TestWorkspace
.CreateCSharp(<text>
Progression\SearchGraphQueryTests_NavigateTo.vb (1)
380
<Project Language="C#" CommonReferences="true" FilePath=<%=
TestWorkspace
.NullFilePath %>>
SymbolSearch\SymbolSearchUpdateEngineTests.vb (13)
26
Using workspace =
TestWorkspace
.CreateCSharp("")
57
Using workspace =
TestWorkspace
.CreateCSharp("")
85
Using workspace =
TestWorkspace
.CreateCSharp("")
123
Using workspace =
TestWorkspace
.CreateCSharp("")
166
Using workspace =
TestWorkspace
.CreateCSharp("")
199
Using workspace =
TestWorkspace
.CreateCSharp("")
247
Using workspace =
TestWorkspace
.CreateCSharp("")
290
Using workspace =
TestWorkspace
.CreateCSharp("")
338
Using workspace =
TestWorkspace
.CreateCSharp("")
397
Using workspace =
TestWorkspace
.CreateCSharp("")
441
Using workspace =
TestWorkspace
.CreateCSharp("")
495
Using workspace =
TestWorkspace
.CreateCSharp("")
555
Using workspace =
TestWorkspace
.CreateCSharp("")
Roslyn.VisualStudio.Next.UnitTests (95)
Services\AssetProviderTests.cs (9)
49
using
var
workspace =
TestWorkspace
.CreateCSharp(file: @"");
73
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
101
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
126
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
156
using var workspace =
TestWorkspace
.CreateCSharp([code1, code2]);
Services\ServiceHubServicesTests.cs (11)
43
private static
TestWorkspace
CreateWorkspace(Type[] additionalParts = null)
51
using
var
workspace = CreateWorkspace();
73
using
var
workspace = CreateWorkspace();
126
using
var
workspace = CreateWorkspace();
177
using
var
workspace = CreateWorkspace();
248
using
var
workspace = CreateWorkspace();
283
using
var
workspace = CreateWorkspace();
420
using
var
localWorkspace = CreateWorkspace();
764
private static DocumentId AddSimpleDocument(
TestWorkspace
workspace, CallbackGenerator generator)
782
private static async Task WaitForSourceGeneratorsAsync(
TestWorkspace
workspace)
1469
TestWorkspace
localWorkspace,
Services\SolutionServiceTests.cs (65)
48
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
65
using
var
workspace =
TestWorkspace
.CreateCSharp(code1);
140
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
166
using
var
workspace =
TestWorkspace
.CreateCSharp("");
214
using
var
workspace =
TestWorkspace
.CreateCSharp("");
249
using
var
workspace =
TestWorkspace
.CreateCSharp("");
329
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
360
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
393
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
425
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
487
using
var
workspace =
TestWorkspace
.CreateCSharp(@"public class C { }");
506
using
var
workspace =
TestWorkspace
.CreateCSharp(@"");
545
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
586
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
627
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
660
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
701
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
741
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
781
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
814
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
869
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
915
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
938
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
972
private static IAsynchronousOperationWaiter GetWorkspaceWaiter(
TestWorkspace
workspace)
983
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
1002
using
var
workspace =
TestWorkspace
.CreateCSharp(code, composition: s_compositionWithFirstDocumentIsActiveAndVisible);
1019
using
var
workspace =
TestWorkspace
.Create("""
1056
using
var
workspace =
TestWorkspace
.CreateCSharp(code, composition: s_compositionWithFirstDocumentIsActiveAndVisible);
1083
using
var
workspace =
TestWorkspace
.CreateCSharp(code, composition: s_compositionWithFirstDocumentIsActiveAndVisible);
1112
using
var
workspace =
TestWorkspace
.CreateCSharp(code, composition: s_compositionWithFirstDocumentIsActiveAndVisible);
1144
using
var
workspace =
TestWorkspace
.Create("""
1219
using
var
workspace =
TestWorkspace
.CreateCSharp(code);
1225
TestWorkspace
workspace,
1232
TestWorkspace
workspace,
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (10)
48
using
var
workspace = CreateWorkspace(LanguageNames.CSharp, code);
76
using
var
workspace = CreateWorkspace(LanguageNames.VisualBasic, code);
109
using
var
workspace = CreateWorkspace(LanguageNames.CSharp, code);
149
using
var
workspace = CreateWorkspace(LanguageNames.CSharp, code);
187
using
var
workspace = CreateWorkspace(LanguageNames.CSharp, code);
218
private static async Task<DiagnosticAnalysisResult> AnalyzeAsync(
TestWorkspace
workspace, ProjectId projectId, Type analyzerType, bool isHostAnalyzer, CancellationToken cancellationToken = default)
248
private static
TestWorkspace
CreateWorkspace(string language, string code, ParseOptions options = null)
252
var
workspace = (language == LanguageNames.CSharp)
253
?
TestWorkspace
.CreateCSharp(code, parseOptions: options, composition: composition)
254
:
TestWorkspace
.CreateVisualBasic(code, parseOptions: options, composition: composition);