@@ -39,7 +39,7 @@ public void CanResolveWorkspaceRelativePath()
39
39
string expectedOutsidePath = TestUtilities . NormalizePath ( "../PeerPath/FilePath.ps1" ) ;
40
40
41
41
// Test with a workspace path
42
- workspace . WorkspacePath = workspacePath ;
42
+ workspace . InitialWorkingDirectory = workspacePath ;
43
43
Assert . Equal ( expectedInsidePath , workspace . GetRelativePath ( testPathInside ) ) ;
44
44
Assert . Equal ( expectedOutsidePath , workspace . GetRelativePath ( testPathOutside ) ) ;
45
45
Assert . Equal ( testPathAnotherDrive , workspace . GetRelativePath ( testPathAnotherDrive ) ) ;
@@ -49,7 +49,7 @@ internal static WorkspaceService FixturesWorkspace()
49
49
{
50
50
return new WorkspaceService ( NullLoggerFactory . Instance )
51
51
{
52
- WorkspacePath = TestUtilities . NormalizePath ( "Fixtures/Workspace" )
52
+ InitialWorkingDirectory = TestUtilities . NormalizePath ( "Fixtures/Workspace" )
53
53
} ;
54
54
}
55
55
@@ -94,18 +94,18 @@ public void CanRecurseDirectoryTree()
94
94
95
95
List < string > expected = new ( )
96
96
{
97
- Path . Combine ( workspace . WorkspacePath , "nested" , "donotfind.ps1" ) ,
98
- Path . Combine ( workspace . WorkspacePath , "nested" , "nestedmodule.psd1" ) ,
99
- Path . Combine ( workspace . WorkspacePath , "nested" , "nestedmodule.psm1" ) ,
100
- Path . Combine ( workspace . WorkspacePath , "rootfile.ps1" )
97
+ Path . Combine ( workspace . InitialWorkingDirectory , "nested" , "donotfind.ps1" ) ,
98
+ Path . Combine ( workspace . InitialWorkingDirectory , "nested" , "nestedmodule.psd1" ) ,
99
+ Path . Combine ( workspace . InitialWorkingDirectory , "nested" , "nestedmodule.psm1" ) ,
100
+ Path . Combine ( workspace . InitialWorkingDirectory , "rootfile.ps1" )
101
101
} ;
102
102
103
103
// .NET Core doesn't appear to use the same three letter pattern matching rule although the docs
104
104
// suggest it should be find the '.ps1xml' files because we search for the pattern '*.ps1'
105
105
// ref https://docs.microsoft.com/en-us/dotnet/api/system.io.directory.getfiles?view=netcore-2.1#System_IO_Directory_GetFiles_System_String_System_String_System_IO_EnumerationOptions_
106
106
if ( RuntimeInformation . FrameworkDescription . StartsWith ( ".NET Framework" ) )
107
107
{
108
- expected . Insert ( 3 , Path . Combine ( workspace . WorkspacePath , "other" , "other.ps1xml" ) ) ;
108
+ expected . Insert ( 3 , Path . Combine ( workspace . InitialWorkingDirectory , "other" , "other.ps1xml" ) ) ;
109
109
}
110
110
111
111
Assert . Equal ( expected , actual ) ;
@@ -122,7 +122,7 @@ public void CanRecurseDirectoryTreeWithLimit()
122
122
maxDepth : 1 ,
123
123
ignoreReparsePoints : s_defaultIgnoreReparsePoints
124
124
) ;
125
- Assert . Equal ( new [ ] { Path . Combine ( workspace . WorkspacePath , "rootfile.ps1" ) } , actual ) ;
125
+ Assert . Equal ( new [ ] { Path . Combine ( workspace . InitialWorkingDirectory , "rootfile.ps1" ) } , actual ) ;
126
126
}
127
127
128
128
[ Fact ]
@@ -138,8 +138,8 @@ public void CanRecurseDirectoryTreeWithGlobs()
138
138
) ;
139
139
140
140
Assert . Equal ( new [ ] {
141
- Path . Combine ( workspace . WorkspacePath , "nested" , "nestedmodule.psd1" ) ,
142
- Path . Combine ( workspace . WorkspacePath , "rootfile.ps1" )
141
+ Path . Combine ( workspace . InitialWorkingDirectory , "nested" , "nestedmodule.psd1" ) ,
142
+ Path . Combine ( workspace . InitialWorkingDirectory , "rootfile.ps1" )
143
143
} , actual ) ;
144
144
}
145
145
@@ -181,7 +181,7 @@ public void CanDetermineIsPathInMemory()
181
181
public void CanOpenAndCloseFile ( )
182
182
{
183
183
WorkspaceService workspace = FixturesWorkspace ( ) ;
184
- string filePath = Path . GetFullPath ( Path . Combine ( workspace . WorkspacePath , "rootfile.ps1" ) ) ;
184
+ string filePath = Path . GetFullPath ( Path . Combine ( workspace . InitialWorkingDirectory , "rootfile.ps1" ) ) ;
185
185
186
186
ScriptFile file = workspace . GetFile ( filePath ) ;
187
187
Assert . Equal ( workspace . GetOpenedFiles ( ) , new [ ] { file } ) ;
0 commit comments