@@ -31,7 +31,7 @@ public class RazorProjectServiceTest : LanguageServerTestBase
31
31
private readonly TestProjectSnapshotManager _projectManager ;
32
32
private readonly SnapshotResolver _snapshotResolver ;
33
33
private readonly DocumentVersionCache _documentVersionCache ;
34
- private readonly RazorProjectService _projectService ;
34
+ private readonly TestRazorProjectService _projectService ;
35
35
36
36
public RazorProjectServiceTest ( ITestOutputHelper testOutput )
37
37
: base ( testOutput )
@@ -45,7 +45,7 @@ public RazorProjectServiceTest(ITestOutputHelper testOutput)
45
45
. Setup ( x => x . Create ( It . IsAny < string > ( ) ) )
46
46
. Returns ( CreateEmptyTextLoader ( ) ) ;
47
47
48
- _projectService = new RazorProjectService (
48
+ _projectService = new TestRazorProjectService (
49
49
remoteTextLoaderFactoryMock . Object ,
50
50
_snapshotResolver ,
51
51
_documentVersionCache ,
@@ -439,7 +439,7 @@ public async Task CloseDocument_ClosesDocumentInOwnerProject()
439
439
440
440
var ownerProjectKey = await _projectService . AddProjectAsync (
441
441
ProjectFilePath , IntermediateOutputPath , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
442
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
442
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
443
443
await _projectService . OpenDocumentAsync ( DocumentFilePath , s_emptyText , version : 42 , DisposalToken ) ;
444
444
445
445
var ownerProject = _projectManager . GetLoadedProject ( ownerProjectKey ) ;
@@ -472,7 +472,7 @@ public async Task CloseDocument_ClosesDocumentInAllOwnerProjects()
472
472
ProjectFilePath , IntermediateOutputPath1 , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
473
473
var ownerProjectKey2 = await _projectService . AddProjectAsync (
474
474
ProjectFilePath , IntermediateOutputPath2 , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
475
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
475
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
476
476
await _projectService . OpenDocumentAsync ( DocumentFilePath , s_emptyText , version : 42 , DisposalToken ) ;
477
477
478
478
var ownerProject1 = _projectManager . GetLoadedProject ( ownerProjectKey1 ) ;
@@ -499,7 +499,7 @@ public async Task CloseDocument_ClosesDocumentInMiscellaneousProject()
499
499
// Arrange
500
500
const string DocumentFilePath = "document.cshtml" ;
501
501
502
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
502
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
503
503
await _projectService . OpenDocumentAsync ( DocumentFilePath , s_emptyText , version : 42 , DisposalToken ) ;
504
504
505
505
var miscProject = await _snapshotResolver . GetMiscellaneousProjectAsync ( DisposalToken ) ;
@@ -529,7 +529,7 @@ public async Task OpenDocument_OpensAlreadyAddedDocumentInOwnerProject()
529
529
530
530
var ownerProjectKey = await _projectService . AddProjectAsync (
531
531
ProjectFilePath , IntermediateOutputPath , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
532
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
532
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
533
533
534
534
var ownerProject = _projectManager . GetLoadedProject ( ownerProjectKey ) ;
535
535
@@ -561,7 +561,7 @@ public async Task OpenDocument_OpensAlreadyAddedDocumentInAllOwnerProjects()
561
561
ProjectFilePath , IntermediateOutputPath1 , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
562
562
var ownerProjectKey2 = await _projectService . AddProjectAsync (
563
563
ProjectFilePath , IntermediateOutputPath2 , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
564
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
564
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
565
565
566
566
var ownerProject1 = _projectManager . GetLoadedProject ( ownerProjectKey1 ) ;
567
567
var ownerProject2 = _projectManager . GetLoadedProject ( ownerProjectKey2 ) ;
@@ -638,14 +638,14 @@ public async Task AddDocument_NoopsIfDocumentIsAlreadyAdded()
638
638
// Arrange
639
639
const string DocumentFilePath = "document.cshtml" ;
640
640
641
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
641
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
642
642
643
643
var miscProject = await _snapshotResolver . GetMiscellaneousProjectAsync ( DisposalToken ) ;
644
644
645
645
using var listener = _projectManager . ListenToNotifications ( ) ;
646
646
647
647
// Act
648
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
648
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
649
649
650
650
// Assert
651
651
listener . AssertNoNotifications ( ) ;
@@ -668,7 +668,7 @@ public async Task AddDocument_AddsDocumentToOwnerProject()
668
668
using var listener = _projectManager . ListenToNotifications ( ) ;
669
669
670
670
// Act
671
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
671
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
672
672
673
673
// Assert
674
674
listener . AssertNotifications (
@@ -688,7 +688,7 @@ public async Task AddDocument_AddsDocumentToMiscellaneousProject()
688
688
using var listener = _projectManager . ListenToNotifications ( ) ;
689
689
690
690
// Act
691
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
691
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
692
692
693
693
// Assert
694
694
listener . AssertNotifications (
@@ -708,7 +708,7 @@ public async Task RemoveDocument_RemovesDocumentFromOwnerProject()
708
708
709
709
var ownerProjectKey = await _projectService . AddProjectAsync (
710
710
ProjectFilePath , IntermediateOutputPath , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
711
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
711
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
712
712
713
713
var ownerProject = _projectManager . GetLoadedProject ( ownerProjectKey ) ;
714
714
@@ -738,7 +738,7 @@ public async Task RemoveDocument_RemovesDocumentFromAllOwnerProjects()
738
738
ProjectFilePath , IntermediateOutputPath1 , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
739
739
var ownerProjectKey2 = await _projectService . AddProjectAsync (
740
740
ProjectFilePath , IntermediateOutputPath2 , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
741
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
741
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
742
742
743
743
var ownerProject1 = _projectManager . GetLoadedProject ( ownerProjectKey1 ) ;
744
744
var ownerProject2 = _projectManager . GetLoadedProject ( ownerProjectKey2 ) ;
@@ -767,7 +767,7 @@ public async Task RemoveOpenDocument_RemovesDocumentFromOwnerProject_MovesToMisc
767
767
768
768
var ownerProjectKey = await _projectService . AddProjectAsync (
769
769
ProjectFilePath , IntermediateOutputPath , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
770
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
770
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
771
771
await _projectService . OpenDocumentAsync ( DocumentFilePath , s_emptyText , version : 42 , DisposalToken ) ;
772
772
773
773
var ownerProject = _projectManager . GetLoadedProject ( ownerProjectKey ) ;
@@ -863,7 +863,7 @@ public async Task UpdateDocument_ChangesDocumentInOwnerProject()
863
863
864
864
var ownerProjectKey = await _projectService . AddProjectAsync (
865
865
ProjectFilePath , IntermediateOutputPath , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
866
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
866
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
867
867
await _projectService . OpenDocumentAsync ( DocumentFilePath , s_emptyText , version : 42 , DisposalToken ) ;
868
868
869
869
var ownerProject = _projectManager . GetLoadedProject ( ownerProjectKey ) ;
@@ -896,7 +896,7 @@ public async Task UpdateDocument_ChangesDocumentInAllOwnerProjects()
896
896
ProjectFilePath , IntermediateOutputPath1 , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
897
897
var ownerProjectKey2 = await _projectService . AddProjectAsync (
898
898
ProjectFilePath , IntermediateOutputPath2 , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
899
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
899
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
900
900
await _projectService . OpenDocumentAsync ( DocumentFilePath , s_emptyText , version : 42 , DisposalToken ) ;
901
901
902
902
var ownerProject1 = _projectManager . GetLoadedProject ( ownerProjectKey1 ) ;
@@ -923,7 +923,7 @@ public async Task UpdateDocument_ChangesDocumentInMiscProject()
923
923
// Arrange
924
924
const string DocumentFilePath = "document.cshtml" ;
925
925
926
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
926
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
927
927
await _projectService . OpenDocumentAsync ( DocumentFilePath , s_emptyText , version : 42 , DisposalToken ) ;
928
928
929
929
var miscProject = await _snapshotResolver . GetMiscellaneousProjectAsync ( DisposalToken ) ;
@@ -953,7 +953,7 @@ public async Task UpdateDocument_TracksKnownDocumentVersion()
953
953
954
954
var ownerProjectKey = await _projectService . AddProjectAsync (
955
955
ProjectFilePath , IntermediateOutputPath , RazorConfiguration . Default , RootNamespace , displayName : null , DisposalToken ) ;
956
- await _projectService . AddDocumentToMiscProjectAsync ( DocumentFilePath , DisposalToken ) ;
956
+ await _projectService . AddDocumentToPotentialProjectsAsync ( DocumentFilePath , DisposalToken ) ;
957
957
958
958
var ownerProject = _projectManager . GetLoadedProject ( ownerProjectKey ) ;
959
959
0 commit comments