33// See the LICENSE file in the project root for more information.
44
55using System ;
6- using System . Collections . Generic ;
7- using System . Collections . Immutable ;
86using System . IO ;
9- using System . Linq ;
107using System . Reflection ;
118using System . Threading ;
129using System . Threading . Tasks ;
1310using Microsoft . CodeAnalysis ;
14- using Microsoft . CodeAnalysis . Diagnostics ;
15- using Microsoft . CodeAnalysis . Editor . Shared . Utilities ;
16- using Microsoft . CodeAnalysis . Execution ;
17- using Microsoft . CodeAnalysis . ExternalAccess . UnitTesting . Api ;
18- using Microsoft . CodeAnalysis . Host . Mef ;
11+ using Microsoft . CodeAnalysis . CSharp . Execution ;
12+ using Microsoft . CodeAnalysis . Editor . Shared . Extensions ;
13+ using Microsoft . CodeAnalysis . Editor . UnitTests ;
1914using Microsoft . CodeAnalysis . Remote ;
2015using Microsoft . CodeAnalysis . Shared . TestHooks ;
21- using Microsoft . CodeAnalysis . SolutionCrawler ;
2216using Microsoft . CodeAnalysis . SymbolSearch ;
2317using Microsoft . CodeAnalysis . Test . Utilities ;
18+ using Microsoft . CodeAnalysis . Test . Utilities . RemoteHost ;
19+ using Microsoft . CodeAnalysis . Text ;
2420using Microsoft . VisualStudio . LanguageServices . Remote ;
2521using Roslyn . Test . Utilities . Remote ;
26- using Roslyn . Utilities ;
2722using Roslyn . VisualStudio . Next . UnitTests . Mocks ;
2823using Xunit ;
2924
@@ -35,11 +30,15 @@ public class RemoteHostClientServiceFactoryTests
3530 [ Fact , Trait ( Traits . Feature , Traits . Features . RemoteHost ) ]
3631 public async Task UpdaterService ( )
3732 {
38- var exportProvider = TestHostServices . CreateMinimalExportProvider ( ) ;
33+ var exportProvider = ExportProviderCache
34+ . GetOrCreateExportProviderFactory ( ServiceTestExportProvider . CreateAssemblyCatalog ( )
35+ . WithParts ( typeof ( InProcRemoteHostClientProvider . Factory ) , typeof ( CSharpOptionsSerializationService ) ) )
36+ . CreateExportProvider ( ) ;
37+
3938 using var workspace = new AdhocWorkspace ( TestHostServices . CreateHostServices ( exportProvider ) ) ;
4039
4140 var options = workspace . CurrentSolution . Options
42- . WithChangedOption ( RemoteHostOptions . SolutionChecksumMonitorBackOffTimeSpanInMS , 1 )
41+ . WithChangedOption ( Microsoft . VisualStudio . LanguageServices . Remote . RemoteHostOptions . SolutionChecksumMonitorBackOffTimeSpanInMS , 1 )
4342 . WithChangedOption ( Microsoft . CodeAnalysis . Test . Utilities . RemoteHost . RemoteHostOptions . RemoteHostTest , true ) ;
4443
4544 workspace . TryApplyChanges ( workspace . CurrentSolution . WithOptions ( options ) ) ;
@@ -52,8 +51,11 @@ public async Task UpdaterService()
5251 // make sure client is ready
5352 using var client = await service . TryGetRemoteHostClientAsync ( CancellationToken . None ) ;
5453
55- // add solution
54+ // add solution, change document
5655 workspace . AddSolution ( SolutionInfo . Create ( SolutionId . CreateNewId ( ) , VersionStamp . Default ) ) ;
56+ var project = workspace . AddProject ( "proj" , LanguageNames . CSharp ) ;
57+ var document = workspace . AddDocument ( project . Id , "doc.cs" , SourceText . From ( "code" ) ) ;
58+ workspace . ApplyTextChanges ( document . Id , new [ ] { new TextChange ( new TextSpan ( 0 , 1 ) , "abc" ) } , CancellationToken . None ) ;
5759
5860 // wait for listener
5961 var workspaceListener = listenerProvider . GetWaiter ( FeatureAttribute . Workspace ) ;
0 commit comments