302 references to GetProject
AnalyzerRunner (4)
Microsoft.Analyzers.Extra.Tests (2)
Microsoft.Analyzers.Local.Tests (2)
Microsoft.AspNetCore.Analyzer.Testing (3)
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (34)
Workspaces\WorkspaceTests_EditorFeatures.cs (32)
289Assert.True(snapshot.GetProject(id1).ProjectReferences.Contains(reference), "ProjectReferences did not contain project2");
328Assert.Equal(0, snapshot.GetProject(id1).ProjectReferences.Count());
414var compilation = await snapshot.GetProject(id1).GetCompilationAsync();
437var compilation2 = await snapshot.GetProject(id2).GetCompilationAsync();
465var compilation2 = await snapshot.GetProject(id2).GetCompilationAsync();
498var compilation2 = await solutionY.GetProject(id2).GetCompilationAsync();
517var compilation2Z = await solutionZ.GetProject(id2).GetCompilationAsync();
552var compilation2y = await solutionY.GetProject(id2).GetCompilationAsync();
578var newVersion = await cs.GetProject(project1.Id).GetDependentSemanticVersionAsync();
620var compilation2y = await solutionY.GetProject(id2).GetCompilationAsync();
766Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count());
787Assert.Equal(0, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count());
1243Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count());
1244Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Count());
1253Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count());
1254Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Count());
1255Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Single().Name);
1279Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count());
1280Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
1289Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count());
1290Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
1291Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Single().Name);
1312Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count());
1313Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Count());
1319Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count());
1320Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Count());
1321Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Single().Name);
1340Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count());
1341Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
1347Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count());
1348Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
1349Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Single().Name);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Microsoft.CodeAnalysis.EditorFeatures (4)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Microsoft.CodeAnalysis.Features (16)
Microsoft.CodeAnalysis.Features.UnitTests (3)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces (18)
Microsoft.CodeAnalysis.Workspaces.MSBuild (4)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (11)
Microsoft.CodeAnalysis.Workspaces.UnitTests (118)
SolutionTests\SolutionTests.cs (98)
336var project = solution.GetProject(projectId)!;
1445Assert.Equal(assemblyName, newSolution.GetProject(projectId)!.AssemblyName);
1922opt => opt.GetProject(projectId)!.AllProjectReferences,
1932Assert.Same(projectRefs, solution2.GetProject(projectId)!.AllProjectReferences);
1952Assert.Same(projectRefs, newSolution1.GetProject(projectId)!.AllProjectReferences);
1955Assert.Empty(newSolution1.GetProject(projectId)!.ProjectReferences);
1983AssertEx.Equal((ProjectReference[])[projectRef2], solution3.GetProject(projectId)!.ProjectReferences);
1984AssertEx.Equal((ProjectReference[])[projectRef2, externalProjectRef], solution3.GetProject(projectId)!.AllProjectReferences);
2016AssertEx.Equal((ProjectReference[])[projectRef2], solution2.GetProject(projectId)!.AllProjectReferences);
2020AssertEx.Equal((ProjectReference[])[externalProjectRef], solution3.GetProject(projectId)!.AllProjectReferences);
2023Assert.Empty(solution4.GetProject(projectId)!.AllProjectReferences);
2081opt => opt.GetProject(projectId)!.MetadataReferences,
2103AssertEx.Equal((MetadataReference[])[metadataRef1, metadataRef2], solution3.GetProject(projectId)!.MetadataReferences);
2126AssertEx.Equal((MetadataReference[])[metadataRef2], solution2.GetProject(projectId)!.MetadataReferences);
2129Assert.Empty(solution3.GetProject(projectId)!.MetadataReferences);
2151opt => opt.GetProject(projectId)!.AnalyzerReferences,
2173AssertEx.Equal((AnalyzerReference[])[analyzerRef1, analyzerRef2], solution3.GetProject(projectId)!.AnalyzerReferences);
2199AssertEx.Equal((AnalyzerReference[])[analyzerRef2], solution2.GetProject(projectId)!.AnalyzerReferences);
2202Assert.Empty(solution3.GetProject(projectId)!.AnalyzerReferences);
2534var project = solution.GetProject(pid);
2546var project = solution.GetProject(project1);
2575var project = solution.GetProject(pid);
2579Assert.Equal(project, solution.GetProject(pid));
2595var project2 = solution.GetProject(pid2);
2644var project1 = solution.GetProject(projectId1);
2645var project2 = solution.GetProject(projectId2);
2740Assert.Throws<ArgumentException>(() => solution.GetProject(projectId2).RemoveDocuments(ImmutableArray.Create(documentInfo1.Id)));
2759Assert.Throws<ArgumentException>(() => solution.GetProject(projectId2).RemoveAdditionalDocuments(ImmutableArray.Create(documentInfo1.Id)));
2778Assert.Throws<ArgumentException>(() => solution.GetProject(projectId2).RemoveAnalyzerConfigDocuments(ImmutableArray.Create(documentInfo1.Id)));
2839Assert.Equal(project, solution.GetProject(project.Id));
2934await solution.GetProject(projectIds[0]).GetCompilationAsync(CancellationToken.None);
2935await solution.GetProject(projectIds[2]).GetCompilationAsync(CancellationToken.None);
2949var assemblyReference = (IAssemblySymbol)solution.GetProject(project1).GetCompilationAsync().Result.GetAssemblyOrModuleSymbol(mefReference);
2956assemblyReference = (IAssemblySymbol)solution.GetProject(project1).GetCompilationAsync().Result.GetAssemblyOrModuleSymbol(mefReference);
3045var oldParseOptions = solution.GetProject(project1).ParseOptions;
3048var newUpdatedParseOptions = solution.GetProject(project1).ParseOptions;
3063var project = sol.GetProject(pid);
3093Assert.True(sol2.GetProject(pid2).AllProjectReferences.Any(r => r.ProjectId == pid), "sol2 project pid2 was expected to contain project reference " + pid);
3118Assert.True(sol2.GetProject(pid2).AllProjectReferences.Any(r => r.ProjectId == pid), "sol2 pid2 was expected to contain " + pid);
3480var proj = sol.GetProject(pid);
3731var observed = solution.GetProject(projectId).GetCompilationAsync().Result;
3756var observed = solution.GetProject(projectId).GetCompilationAsync().Result;
3971var project3 = solution.GetProject(pid3);
3979project3 = solution2.GetProject(pid3);
4241Assert.True(await frozenSolution.GetProject(project1.Id).HasSuccessfullyLoadedAsync(CancellationToken.None));
4242Assert.True(await frozenSolution.GetProject(project2.Id).HasSuccessfullyLoadedAsync(CancellationToken.None));
4566VersionStamp GetVersion() => solution.GetProject(pid).Version;
4567ImmutableArray<DocumentId> GetDocumentIds() => [.. solution.GetProject(pid).DocumentIds];
4570return solution.GetProject(pid).GetCompilationAsync().Result.SyntaxTrees.ToImmutableArray();
4680var originalCompilation = await solution.GetProject(projectId).GetCompilationAsync();
4691var project = solution.GetProject(projectId);
4725var project = solution.GetProject(projectId);
4732project = solution.GetProject(projectId);
4766var project = solution.GetProject(projectId);
4779project = solution.GetProject(projectId);
4801var originalProvider = solution.GetProject(projectId).CompilationOptions.SyntaxTreeOptionsProvider;
4812var newProvider = solution.GetProject(projectId).CompilationOptions.SyntaxTreeOptionsProvider;
4817var finalProvider = solution.GetProject(projectId).CompilationOptions.SyntaxTreeOptionsProvider;
4843var originalCompilation = await solution.GetProject(projectId).GetCompilationAsync();
4859var newCompilation = await solution.GetProject(projectId).GetCompilationAsync();
4972var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync();
4973var compilation2 = await solution.GetProject(projectId2).GetCompilationAsync();
4996Assert.True(solution.GetProject(projectId1).ProjectReferences.Contains(p => p.ProjectId == projectId2));
4998var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync();
4999var compilation2 = await solution.GetProject(projectId2).GetCompilationAsync();
5024Assert.True(solution.GetProject(projectId2).ProjectReferences.Contains(p => p.ProjectId == projectId1));
5026var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync();
5027var compilation2 = await solution.GetProject(projectId2).GetCompilationAsync();
5043var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync();
5055var compilation1New = await solution.GetProject(projectId1).GetCompilationAsync();
5073var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync();
5086var compilation1New = await solution.GetProject(projectId1).GetCompilationAsync();
5105var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync();
5118var compilation1New = await solution.GetProject(projectId1).GetCompilationAsync();
5123var compilation2 = await solution.GetProject(projectId2).GetCompilationAsync();
5124var compilation3 = await solution.GetProject(projectId2).GetCompilationAsync();
5170var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync();
5171var compilation2 = await solution.GetProject(projectId2).GetCompilationAsync();
5172var compilation3 = await solution.GetProject(projectId2).GetCompilationAsync();
5215var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync();
5216var compilation2 = await solution.GetProject(projectId2).GetCompilationAsync();
5217var compilation3 = await solution.GetProject(projectId2).GetCompilationAsync();
5616project1 = project2.Solution.GetProject(project1.Id).AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project;
5617project2 = project1.Solution.GetProject(project2.Id).AddDocument("Doc2", SourceText.From("class Doc2 { }")).Project;
5618project1 = project2.Solution.GetProject(project1.Id);
5624var frozenProject1 = frozenSolution.GetProject(project1.Id);
5627var frozenProject2 = frozenSolution.GetProject(project2.Id);
5644project1 = project2.Solution.GetProject(project1.Id).AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project;
5645project2 = project1.Solution.GetProject(project2.Id).AddDocument("Doc2", SourceText.From("class Doc2 { }")).Project;
5648project1 = project2.Solution.GetProject(project1.Id);
5654var frozenProject1 = frozenSolution.GetProject(project1.Id);
5661var frozenProject2 = frozenSolution.GetProject(project2.Id);
5674project1 = project2.Solution.GetProject(project1.Id).AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project;
5675project2 = project1.Solution.GetProject(project2.Id).AddDocument("Doc2", SourceText.From("class Doc2 { }")).Project;
5678project1 = project2.Solution.GetProject(project1.Id);
5684var frozenProject1 = frozenSolution.GetProject(project1.Id);
5691var frozenProject2 = frozenSolution.GetProject(project2.Id);
5715var forkedProject1 = frozenSolution.WithDocumentText(project1.Documents.Single().Id, SourceText.From("class Doc2 { }")).GetProject(project1.Id);
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
Microsoft.Gen.Logging.Unit.Tests (1)
Microsoft.Gen.Metrics.Unit.Tests (1)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
Microsoft.Interop.ComInterfaceGenerator (2)
Microsoft.Interop.LibraryImportGenerator (2)
Microsoft.ML.CodeAnalyzer.Tests (3)
Microsoft.VisualStudio.LanguageServices (33)
Preview\ReferenceChange.cs (3)
33var projectName = oldSolution.GetProject(projectId).Name;
49.Select(r => new ProjectReferenceChange(r, newSolution.GetProject(r.ProjectId).Name, projectId, projectName, isAdded: true, engine: engine));
54.Select(r => new ProjectReferenceChange(r, oldSolution.GetProject(r.ProjectId).Name, projectId, projectName, isAdded: false, engine: engine));
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Roslyn.VisualStudio.Next.UnitTests (16)
System.Windows.Forms.Analyzers.CSharp.Tests (1)