44using System ;
55using System . IO ;
66using System . Linq ;
7- using System . Reflection ;
87using System . Runtime . InteropServices ;
98using System . Text ;
109using System . Threading ;
@@ -21,11 +20,8 @@ namespace PowerShellEditorServices.Test.E2E
2120 [ Trait ( "Category" , "DAP" ) ]
2221 public class DebugAdapterProtocolMessageTests : IAsyncLifetime , IDisposable
2322 {
24- private const string TestOutputFileName = "__dapTestOutputFile.txt" ;
2523 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 ) ;
24+ private static readonly string s_testOutputPath = Path . Combine ( Path . GetTempPath ( ) , Path . GetRandomFileName ( ) , "__dapTestOutputFile.txt" ) ;
2925
3026 private readonly ITestOutputHelper _output ;
3127 private DebugAdapterClient PsesDebugAdapterClient ;
@@ -116,7 +112,7 @@ public void Dispose()
116112 private static string NewTestFile ( string script , bool isPester = false )
117113 {
118114 string fileExt = isPester ? ".Tests.ps1" : ".ps1" ;
119- string filePath = Path . Combine ( s_binDir , Path . GetRandomFileName ( ) + fileExt ) ;
115+ string filePath = Path . Combine ( Path . GetTempPath ( ) , Path . GetRandomFileName ( ) + fileExt ) ;
120116 File . WriteAllText ( filePath , script ) ;
121117
122118 return filePath ;
0 commit comments