Skip to content

Commit db0615f

Browse files
use temp path
1 parent 0b780cc commit db0615f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/PowerShellEditorServices.Test/Language/TokenOperationsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class TokenOperationsTests
1919
private FoldingReference[] GetRegions(string text) {
2020
ScriptFile scriptFile = new ScriptFile(
2121
// Use any absolute path. Even if it doesn't exist.
22-
new Uri(Path.Combine(typeof(TokenOperationsTests).Assembly.Location, "TestFile.ps1")),
22+
new Uri(Path.Combine(Path.GetTempPath(), "TestFile.ps1")),
2323
text,
2424
Version.Parse("5.0"));
2525

test/PowerShellEditorServices.Test/Session/ScriptFileTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public void FindsDotSourcedFiles()
191191
ScriptFile scriptFile =
192192
new ScriptFile(
193193
// Use any absolute path. Even if it doesn't exist.
194-
new Uri(Path.Combine(typeof(ScriptFileChangeTests).Assembly.Location, "TestFile.ps1")),
194+
new Uri(Path.Combine(Path.GetTempPath(), "TestFile.ps1")),
195195
stringReader,
196196
PowerShellVersion);
197197

@@ -248,7 +248,7 @@ internal static ScriptFile CreateScriptFile(string initialString)
248248
ScriptFile fileToChange =
249249
new ScriptFile(
250250
// Use any absolute path. Even if it doesn't exist.
251-
new Uri(Path.Combine(typeof(ScriptFileChangeTests).Assembly.Location, "TestFile.ps1")),
251+
new Uri(Path.Combine(Path.GetTempPath(), "TestFile.ps1")),
252252
stringReader,
253253
PowerShellVersion);
254254

@@ -573,7 +573,7 @@ public class ScriptFileConstructorTests
573573
public void PropertiesInitializedCorrectlyForFile()
574574
{
575575
// Use any absolute path. Even if it doesn't exist.
576-
var path = Path.Combine(typeof(ScriptFileChangeTests).Assembly.Location, "TestFile.ps1");
576+
var path = Path.Combine(Path.GetTempPath(), "TestFile.ps1");
577577
var scriptFile = ScriptFileChangeTests.CreateScriptFile("");
578578

579579
Assert.Equal(path, scriptFile.FilePath);

0 commit comments

Comments
 (0)