diff --git a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/ProcessFrameworkReferencesTests.cs b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/ProcessFrameworkReferencesTests.cs index b9806916dfcc..bfa497b8d6fa 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/ProcessFrameworkReferencesTests.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/ProcessFrameworkReferencesTests.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.IO; using FluentAssertions; using Xunit; @@ -166,6 +167,11 @@ public void Given_KnownFrameworkReferences_with_RuntimeCopyLocal_It_resolves_Fra } }; + if (Environment.OSVersion.Platform != PlatformID.Win32NT) + { + task.Execute().Should().BeFalse("IsWindowsOnly=true"); + return; + } task.Execute().Should().BeTrue(); task.PackagesToDownload.Length.Should().Be(1); @@ -241,10 +247,16 @@ public void It_resolves_self_contained_FrameworkReferences_to_download() }), } }; + if (Environment.OSVersion.Platform == PlatformID.Win32NT) + { + task.Execute().Should().BeTrue(); - task.Execute().Should().BeTrue(); - - task.PackagesToDownload.Length.Should().Be(2); + task.PackagesToDownload.Length.Should().Be(2); + } + else + { + task.Execute().Should().BeFalse("IsWindowsOnly=true"); + } } } }