diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppHostUsedWithSymbolicLinks.cs b/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppHostUsedWithSymbolicLinks.cs index b36fb4311791f..f5e7a32a440b5 100644 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppHostUsedWithSymbolicLinks.cs +++ b/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppHostUsedWithSymbolicLinks.cs @@ -69,15 +69,15 @@ public void Run_apphost_behind_transitive_symlinks(string firstSymlinkRelativePa var appExe = fixture.TestProject.AppExe; var testDir = Directory.GetParent(fixture.TestProject.Location).ToString(); - Directory.CreateDirectory(Path.Combine(testDir, Path.GetDirectoryName(firstSymlinkRelativePath))); - Directory.CreateDirectory(Path.Combine(testDir, Path.GetDirectoryName(secondSymlinkRelativePath))); // second symlink -> apphost string secondSymbolicLink = Path.Combine(testDir, secondSymlinkRelativePath); + Directory.CreateDirectory(Path.GetDirectoryName(secondSymbolicLink)); CreateSymbolicLink(secondSymbolicLink, appExe); // first symlink -> second symlink string firstSymbolicLink = Path.Combine(testDir, firstSymlinkRelativePath); + Directory.CreateDirectory(Path.GetDirectoryName(firstSymbolicLink)); CreateSymbolicLink(firstSymbolicLink, secondSymbolicLink); Command.Create(firstSymbolicLink) @@ -86,12 +86,6 @@ public void Run_apphost_behind_transitive_symlinks(string firstSymlinkRelativePa .Execute() .Should().Pass() .And.HaveStdOutContaining("Hello World"); - - if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - Directory.Delete(firstSymbolicLink); - Directory.Delete(secondSymbolicLink); - } } //[Theory] @@ -199,11 +193,6 @@ public void Put_dotnet_behind_symlink() .Execute() .Should().Pass() .And.HaveStdOutContaining("Hello World"); - - if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - Directory.Delete(dotnetSymlink); - } } [Fact]