Skip to content

Commit 53f1b83

Browse files
committed
Don't make temp test files in bin directory
1 parent 1cbbcfc commit 53f1b83

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

test/PowerShellEditorServices.Test.E2E/DebugAdapterProtocolMessageTests.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ namespace PowerShellEditorServices.Test.E2E
2121
[Trait("Category", "DAP")]
2222
public class DebugAdapterProtocolMessageTests : IAsyncLifetime, IDisposable
2323
{
24-
private const string TestOutputFileName = "__dapTestOutputFile.txt";
2524
private static readonly bool s_isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
26-
private static readonly string s_binDir =
27-
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
28-
private static readonly string s_testOutputPath = Path.Combine(s_binDir, TestOutputFileName);
25+
private static readonly string s_testOutputPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName(), "__dapTestOutputFile.txt");
2926

3027
private readonly ITestOutputHelper _output;
3128
private DebugAdapterClient PsesDebugAdapterClient;
@@ -116,7 +113,7 @@ public void Dispose()
116113
private static string NewTestFile(string script, bool isPester = false)
117114
{
118115
string fileExt = isPester ? ".Tests.ps1" : ".ps1";
119-
string filePath = Path.Combine(s_binDir, Path.GetRandomFileName() + fileExt);
116+
string filePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + fileExt);
120117
File.WriteAllText(filePath, script);
121118

122119
return filePath;

test/PowerShellEditorServices.Test/Language/SymbolsServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ public void FindsSymbolsInFile()
832832
Assert.True(symbol.IsDeclaration);
833833

834834
// There should be no region symbols unless the provider has been registered.
835-
Assert.Empty(symbols.Where(i => i.Type == SymbolType.Region));
835+
Assert.DoesNotContain(symbols, i => i.Type == SymbolType.Region)
836836
}
837837

838838
[Fact]

0 commit comments

Comments
 (0)