diff --git a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs index 8bde5e77e..47b95ab21 100644 --- a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs +++ b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs @@ -130,6 +130,12 @@ namespace Microsoft.DotNet.Cli.Test.Tests String[] trxFiles = Directory.GetFiles(trxLoggerDirectory, "*.trx"); Assert.Equal(1, trxFiles.Length); result.StdOut.Should().Contain(trxFiles[0]); + + // Cleanup trxLoggerDirectory if it exist + if(Directory.Exists(trxLoggerDirectory)) + { + Directory.Delete(trxLoggerDirectory, true); + } } } } \ No newline at end of file