diff --git a/src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs b/src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs index 6e9e91f403a5c809c5b27536a078de11c7128600..e49a5d5e46b8fe4eab021e6a61b9848367e52c9d 100644 --- a/src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs +++ b/src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -282,6 +283,37 @@ public async Task TestAdditionalDocument() } } + [Fact, Trait(Traits.Feature, Traits.Features.RemoteHost)] + public async Task TestAnalyzerConfigDocument() + { + var code = @"class Test { void Method() { } }"; + using (var workspace = TestWorkspace.CreateCSharp(code)) + { + var projectId = workspace.CurrentSolution.ProjectIds.First(); + var analyzerConfigDocumentId = DocumentId.CreateNewId(projectId); + var analyzerConfigDocumentInfo = DocumentInfo.Create( + analyzerConfigDocumentId, ".editorconfig", + loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create()))); + + await VerifySolutionUpdate(workspace, s => + { + return s.AddAnalyzerConfigDocuments(ImmutableArray.Create(analyzerConfigDocumentInfo)); + }); + + workspace.OnAnalyzerConfigDocumentAdded(analyzerConfigDocumentInfo); + + await VerifySolutionUpdate(workspace, s => + { + return s.WithAnalyzerConfigDocumentText(analyzerConfigDocumentId, SourceText.From("root = false")); + }); + + await VerifySolutionUpdate(workspace, s => + { + return s.RemoveAnalyzerConfigDocument(analyzerConfigDocumentId); + }); + } + } + [Fact, Trait(Traits.Feature, Traits.Features.RemoteHost)] public async Task TestDocument() {