4
4
using System ;
5
5
using System . IO ;
6
6
using System . Linq ;
7
- using System . Reflection ;
8
7
using System . Runtime . InteropServices ;
9
8
using System . Text ;
10
9
using System . Threading ;
@@ -21,11 +20,8 @@ namespace PowerShellEditorServices.Test.E2E
21
20
[ Trait ( "Category" , "DAP" ) ]
22
21
public class DebugAdapterProtocolMessageTests : IAsyncLifetime , IDisposable
23
22
{
24
- private const string TestOutputFileName = "__dapTestOutputFile.txt" ;
25
23
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" ) ;
29
25
30
26
private readonly ITestOutputHelper _output ;
31
27
private DebugAdapterClient PsesDebugAdapterClient ;
@@ -116,7 +112,7 @@ public void Dispose()
116
112
private static string NewTestFile ( string script , bool isPester = false )
117
113
{
118
114
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 ) ;
120
116
File . WriteAllText ( filePath , script ) ;
121
117
122
118
return filePath ;
0 commit comments