44using System . IO ;
55using System . IO . Compression ;
66using System . Linq ;
7- using System . Reflection ;
87using Microsoft . VisualStudio . TestTools . UnitTesting ;
98using Newtonsoft . Json ;
109using Newtonsoft . Json . Serialization ;
@@ -31,8 +30,7 @@ public TestResultComposer(TestContext testContext, bool useDedicatedTestResultsD
3130 this . _testContext = testContext ;
3231 this . _useDedicatedTestResultsDirectory = useDedicatedTestResultsDirectory ;
3332 this . _defaultRunDirectory = testContext . TestRunResultsDirectory ;
34- string dedicatedRunDirectory = BuildDedicatedRunDirectory ( testContext ) ;
35- this . RunDirectory = this . _useDedicatedTestResultsDirectory ? dedicatedRunDirectory : this . _defaultRunDirectory ;
33+ this . RunDirectory = this . _useDedicatedTestResultsDirectory ? TestRun . GetTestRunDirectory ( testContext ) : this . _defaultRunDirectory ;
3634 this . TestDirectory = Path . Combine ( this . RunDirectory , "TestResults" , testContext . TestName ) ;
3735 this . _expectedDirectory = Path . Combine ( this . RunDirectory , ExpectedDirectoryName ) ;
3836 this . _actualDirectory = Path . Combine ( this . RunDirectory , ActualDirectoryName ) ;
@@ -217,15 +215,6 @@ private static void EnsureDirectory(string path)
217215 Directory . CreateDirectory ( directory ) ;
218216 }
219217
220- private static string BuildDedicatedRunDirectory ( TestContext testContext )
221- {
222- Assembly assembly = TestImplementationResolver . ResolveTestAssembly ( testContext ) ;
223- string assemblyName = assembly . GetName ( ) . Name ;
224- string directoryName = $ "Run_{ DateTime . Now : yyyy-MM-dd HH_mm_ss} ";
225- string path = Path . Combine ( Path . GetTempPath ( ) , "TestResults" , directoryName , assemblyName ) ;
226- return path ;
227- }
228-
229218 // Exposing the original enum System.Diagnostics.EventLogEntryType in the AddLastEventLogEntries method, causes the coverlet.collector to hang.
230219 // Might be related to: https://github.com/coverlet-coverage/coverlet/issues/1044
231220 public enum EventLogEntryType
0 commit comments