diff --git a/src/installer/tests/HostActivation.Tests/FrameworkResolution/MultipleHives.cs b/src/installer/tests/HostActivation.Tests/FrameworkResolution/MultipleHives.cs index 4e764ffa3a21c6..0a12cd2640ce9b 100644 --- a/src/installer/tests/HostActivation.Tests/FrameworkResolution/MultipleHives.cs +++ b/src/installer/tests/HostActivation.Tests/FrameworkResolution/MultipleHives.cs @@ -21,14 +21,9 @@ public MultipleHives(SharedTestState sharedState) } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multiple hives are only supported on Windows. public void FrameworkHiveSelection_GlobalHiveWithBetterMatch() { - if (!OperatingSystem.IsWindows()) - { - // Multiple hives are only supported on Windows. - return; - } - RunTest( runtimeConfig => runtimeConfig .WithFramework(MicrosoftNETCoreApp, "5.0.0")) @@ -36,14 +31,9 @@ public void FrameworkHiveSelection_GlobalHiveWithBetterMatch() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multiple hives are only supported on Windows. public void FrameworkHiveSelection_MainHiveWithBetterMatch() { - if (!OperatingSystem.IsWindows()) - { - // Multiple hives are only supported on Windows. - return; - } - RunTest( runtimeConfig => runtimeConfig .WithFramework(MicrosoftNETCoreApp, "6.0.0")) @@ -51,14 +41,9 @@ public void FrameworkHiveSelection_MainHiveWithBetterMatch() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multiple hives are only supported on Windows. public void FrameworkHiveSelection_CurrentDirectoryIsIgnored() { - if (!OperatingSystem.IsWindows()) - { - // Multiple hives are only supported on Windows. - return; - } - RunTest( SharedState.DotNetMainHive, SharedState.FrameworkReferenceApp, diff --git a/src/installer/tests/HostActivation.Tests/MultilevelSDKLookup.cs b/src/installer/tests/HostActivation.Tests/MultilevelSDKLookup.cs index 3a7f31e34a81d4..97b3387604b623 100644 --- a/src/installer/tests/HostActivation.Tests/MultilevelSDKLookup.cs +++ b/src/installer/tests/HostActivation.Tests/MultilevelSDKLookup.cs @@ -89,14 +89,9 @@ public void Dispose() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multi-level lookup is only supported on Windows. public void SdkMultilevelLookup_Global_Json_Single_Digit_Patch_Rollup() { - if (!OperatingSystem.IsWindows()) - { - // Multi-level lookup is only supported on Windows. - return; - } - // Set specified SDK version = 9999.3.4-global-dummy SetGlobalJsonVersion("SingleDigit-global.json"); @@ -264,14 +259,9 @@ public void SdkMultilevelLookup_Global_Json_Single_Digit_Patch_Rollup() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multi-level lookup is only supported on Windows. public void SdkMultilevelLookup_Global_Json_Two_Part_Patch_Rollup() { - if (!OperatingSystem.IsWindows()) - { - // Multi-level lookup is only supported on Windows. - return; - } - // Set specified SDK version = 9999.3.304-global-dummy SetGlobalJsonVersion("TwoPart-global.json"); @@ -444,14 +434,9 @@ public void SdkMultilevelLookup_Global_Json_Two_Part_Patch_Rollup() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multi-level lookup is only supported on Windows. public void SdkMultilevelLookup_Precedential_Order() { - if (!OperatingSystem.IsWindows()) - { - // Multi-level lookup is only supported on Windows. - return; - } - WriteEmptyGlobalJson(); // Add SDK versions @@ -498,6 +483,7 @@ public void SdkMultilevelLookup_Precedential_Order() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multi-level lookup is only supported on Windows. public void SdkMultilevelLookup_RegistryAccess() { // The purpose of this test is to verify that the product uses correct code to access @@ -511,12 +497,6 @@ public void SdkMultilevelLookup_RegistryAccess() // different registry key, inside the HKEY_CURRENT_USER hive which is writable without admin. // Note that the test creates a unique key (based on PID) for every run, to avoid collisions between parallel running tests. - if (!OperatingSystem.IsWindows()) - { - // Multi-level lookup is only supported on Windows. - return; - } - WriteEmptyGlobalJson(); using (var registeredInstallLocationOverride = new RegisteredInstallLocationOverride(DotNet.GreatestVersionHostFxrFilePath)) @@ -547,14 +527,9 @@ public void SdkMultilevelLookup_RegistryAccess() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multi-level lookup is only supported on Windows. public void SdkMultilevelLookup_Must_Pick_The_Highest_Semantic_Version() { - if (!OperatingSystem.IsWindows()) - { - // Multi-level lookup is only supported on Windows. - return; - } - WriteEmptyGlobalJson(); // Add SDK versions diff --git a/src/installer/tests/HostActivation.Tests/MultilevelSharedFxLookup.cs b/src/installer/tests/HostActivation.Tests/MultilevelSharedFxLookup.cs index 9638ed52c496e6..788963fa33e49b 100644 --- a/src/installer/tests/HostActivation.Tests/MultilevelSharedFxLookup.cs +++ b/src/installer/tests/HostActivation.Tests/MultilevelSharedFxLookup.cs @@ -129,14 +129,9 @@ public void Dispose() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multi-level lookup is only supported on Windows. public void SharedMultilevelFxLookup_Must_Verify_Folders_in_the_Correct_Order() { - if (!OperatingSystem.IsWindows()) - { - // Multi-level lookup is only supported on Windows. - return; - } - var fixture = SharedFxLookupPortableAppFixture .Copy(); @@ -246,14 +241,9 @@ public void SharedMultilevelFxLookup_Must_Verify_Folders_in_the_Correct_Order() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multi-level lookup is only supported on Windows. public void SharedMultilevelFxLookup_Must_Not_Roll_Forward_If_Framework_Version_Is_Specified_Through_Argument() { - if (!OperatingSystem.IsWindows()) - { - // Multi-level lookup is only supported on Windows. - return; - } - var fixture = SharedFxLookupPortableAppFixture .Copy(); diff --git a/src/installer/tests/HostActivation.Tests/NativeHostApis.cs b/src/installer/tests/HostActivation.Tests/NativeHostApis.cs index 04b42190ac26f1..aaabf8e571bcd2 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHostApis.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHostApis.cs @@ -128,14 +128,9 @@ public SdkResolutionFixture(SharedTestState state) } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multi-level lookup is only supported on Windows. public void Hostfxr_get_available_sdks_with_multilevel_lookup() { - if (!OperatingSystem.IsWindows()) - { - // multilevel lookup is not supported on non-Windows - return; - } - var f = new SdkResolutionFixture(sharedTestState); // With multi-level lookup (windows only): get local and global sdks sorted by ascending version, @@ -322,14 +317,9 @@ public void Hostfxr_get_dotnet_environment_info_dotnet_root_only() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multi-level lookup is only supported on Windows. public void Hostfxr_get_dotnet_environment_info_with_multilevel_lookup_with_dotnet_root() { - if (!OperatingSystem.IsWindows()) - { - // Only Windows supports multi-level lookup. - return; - } - var f = new SdkResolutionFixture(sharedTestState); string expectedSdkVersions = string.Join(';', new[] { @@ -406,14 +396,9 @@ public void Hostfxr_get_dotnet_environment_info_with_multilevel_lookup_with_dotn } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Multi-level lookup is only supported on Windows. public void Hostfxr_get_dotnet_environment_info_with_multilevel_lookup_only() { - if (!OperatingSystem.IsWindows()) - { - // Only Windows supports multi-level lookup. - return; - } - var f = new SdkResolutionFixture(sharedTestState); string expectedSdkVersions = string.Join(';', new[] { diff --git a/src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs b/src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs index feb86741067dd7..d48d8439008966 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs @@ -23,17 +23,12 @@ public Comhost(SharedTestState sharedTestState) } [Theory] + [PlatformSpecific(TestPlatforms.Windows)] // COM activation is only supported on Windows [InlineData(1, true)] [InlineData(10, true)] [InlineData(10, false)] public void ActivateClass(int count, bool synchronous) { - if (!OperatingSystem.IsWindows()) - { - // COM activation is only supported on Windows - return; - } - string [] args = { "comhost", synchronous ? "synchronous" : "concurrent", @@ -54,14 +49,9 @@ public void ActivateClass(int count, bool synchronous) } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // COM activation is only supported on Windows public void ActivateClass_IgnoreAppLocalHostFxr() { - if (!OperatingSystem.IsWindows()) - { - // COM activation is only supported on Windows - return; - } - using (var fixture = sharedState.ComLibraryFixture.Copy()) { File.WriteAllText(Path.Combine(fixture.TestProject.BuiltApp.Location, "hostfxr.dll"), string.Empty); @@ -87,14 +77,9 @@ public void ActivateClass_IgnoreAppLocalHostFxr() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // COM activation is only supported on Windows public void ActivateClass_ValidateIErrorInfoResult() { - if (!OperatingSystem.IsWindows()) - { - // COM activation is only supported on Windows - return; - } - using (var fixture = sharedState.ComLibraryFixture.Copy()) { string missingRuntimeConfig = Path.Combine(fixture.TestProject.BuiltApp.Location, @@ -122,14 +107,9 @@ public void ActivateClass_ValidateIErrorInfoResult() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // COM activation is only supported on Windows public void LoadTypeLibraries() { - if (!OperatingSystem.IsWindows()) - { - // COM activation is only supported on Windows - return; - } - using (var fixture = sharedState.ComLibraryFixture.Copy()) { var comHost = Path.Combine( diff --git a/src/installer/tests/HostActivation.Tests/NativeHosting/ComhostSideBySide.cs b/src/installer/tests/HostActivation.Tests/NativeHosting/ComhostSideBySide.cs index 716a98b050999c..623f93a8fdce5d 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHosting/ComhostSideBySide.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHosting/ComhostSideBySide.cs @@ -23,14 +23,9 @@ public ComhostSideBySide(SharedTestState sharedTestState) } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // COM activation is only supported on Windows public void ActivateClass() { - if (!OperatingSystem.IsWindows()) - { - // COM activation is only supported on Windows - return; - } - string [] args = { "activation", sharedState.ClsidString @@ -47,14 +42,9 @@ public void ActivateClass() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // COM activation is only supported on Windows public void LocateEmbeddedTlb() { - if (!OperatingSystem.IsWindows()) - { - // COM activation is only supported on Windows - return; - } - string [] args = { "typelib_lookup", sharedState.TypeLibId diff --git a/src/installer/tests/HostActivation.Tests/NativeHosting/Nethost.cs b/src/installer/tests/HostActivation.Tests/NativeHosting/Nethost.cs index 4e27599b99ef30..0f18161b026827 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHosting/Nethost.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHosting/Nethost.cs @@ -179,6 +179,7 @@ public void GetHostFxrPath_HostFxrAlreadyLoaded() } [Theory] + [SkipOnPlatform(TestPlatforms.Windows, "This test targets the install_location config file which is only used on Linux and macOS.")] [InlineData("{0}", true)] [InlineData("{0}\n", true)] [InlineData("{0}\nSome other text", true)] @@ -189,12 +190,6 @@ public void GetHostFxrPath_HostFxrAlreadyLoaded() [InlineData("{0} ", false)] public void GetHostFxrPath_InstallLocationFile(string value, bool shouldPass) { - if (OperatingSystem.IsWindows()) - { - // This test targets the install_location config file which is only used on Linux and macOS. - return; - } - string installLocation = Path.Combine(sharedState.ValidInstallRoot, "dotnet"); using (var registeredInstallLocationOverride = new RegisteredInstallLocationOverride(sharedState.NethostPath)) diff --git a/src/installer/tests/HostActivation.Tests/PortableAppActivation.cs b/src/installer/tests/HostActivation.Tests/PortableAppActivation.cs index f25929d6d5f1c2..14060b5e944bfa 100644 --- a/src/installer/tests/HostActivation.Tests/PortableAppActivation.cs +++ b/src/installer/tests/HostActivation.Tests/PortableAppActivation.cs @@ -456,16 +456,11 @@ public void AppHost_CLI_FrameworkDependent_MissingRuntimeFramework_ErrorReported } [Theory] + [PlatformSpecific(TestPlatforms.Windows)] // GUI app host is only supported on Windows. [InlineData(true)] [InlineData(false)] public void AppHost_GUI_FrameworkDependent_MissingRuntimeFramework_ErrorReportedInDialog(bool missingHostfxr) { - if (!OperatingSystem.IsWindows()) - { - // GUI app host is only supported on Windows. - return; - } - var fixture = sharedTestState.PortableAppFixture_Built .Copy(); @@ -521,13 +516,9 @@ public void AppHost_GUI_FrameworkDependent_MissingRuntimeFramework_ErrorReported } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // GUI app host is only supported on Windows. public void AppHost_GUI_NoCustomErrorWriter_FrameworkMissing_ErrorReportedInDialog() { - if (!OperatingSystem.IsWindows()) - { - return; - } - var fixture = sharedTestState.PortableAppFixture_Built .Copy(); @@ -564,14 +555,9 @@ public void AppHost_GUI_NoCustomErrorWriter_FrameworkMissing_ErrorReportedInDial } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // GUI app host is only supported on Windows. public void AppHost_GUI_FrameworkDependent_DisabledGUIErrors_DialogNotShown() { - if (!OperatingSystem.IsWindows()) - { - // GUI app host is only supported on Windows. - return; - } - var fixture = sharedTestState.PortableAppFixture_Built .Copy(); diff --git a/src/installer/tests/HostActivation.Tests/StandaloneAppActivation.cs b/src/installer/tests/HostActivation.Tests/StandaloneAppActivation.cs index b4a3ea15f99a27..b7ec6eb9688916 100644 --- a/src/installer/tests/HostActivation.Tests/StandaloneAppActivation.cs +++ b/src/installer/tests/HostActivation.Tests/StandaloneAppActivation.cs @@ -237,14 +237,9 @@ public void Running_Publish_Output_Standalone_EXE_with_Bound_AppHost_Succeeds() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // GUI app host is only supported on Windows. public void Running_AppHost_with_GUI_No_Console() { - if (!OperatingSystem.IsWindows()) - { - // GUI app host is only supported on Windows. - return; - } - var fixture = sharedTestState.StandaloneAppFixture_Published .Copy(); @@ -263,14 +258,9 @@ public void Running_AppHost_with_GUI_No_Console() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // GUI app host is only supported on Windows. public void Running_AppHost_with_GUI_Traces() { - if (!OperatingSystem.IsWindows()) - { - // GUI app host is only supported on Windows. - return; - } - var fixture = sharedTestState.StandaloneAppFixture_Published .Copy(); diff --git a/src/installer/tests/HostActivation.Tests/WindowsSpecificBehavior.cs b/src/installer/tests/HostActivation.Tests/WindowsSpecificBehavior.cs index df8ec21ba237ae..b97f38304f7538 100644 --- a/src/installer/tests/HostActivation.Tests/WindowsSpecificBehavior.cs +++ b/src/installer/tests/HostActivation.Tests/WindowsSpecificBehavior.cs @@ -18,14 +18,9 @@ public WindowsSpecificBehavior(SharedTestState fixture) } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] // Manifests are only supported on Windows OSes. public void MuxerRunsPortableAppWithoutWindowsOsShims() { - if (!OperatingSystem.IsWindows()) - { - // Manifests are only supported on Windows OSes. - return; - } - TestProjectFixture portableAppFixture = sharedTestState.TestWindowsOsShimsAppFixture.Copy(); portableAppFixture.BuiltDotnet.Exec(portableAppFixture.TestProject.AppDll) @@ -37,13 +32,9 @@ public void MuxerRunsPortableAppWithoutWindowsOsShims() } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] public void FrameworkDependent_DLL_LongPath_Succeeds() { - if (!OperatingSystem.IsWindows()) - { - return; - } - // Long paths must also be enabled via a machine-wide setting. Only run the test if it is enabled. using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\FileSystem")) { diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/HammerServiceTest.cs b/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/HammerServiceTest.cs index d38943fbea54b8..d173883559f7df 100644 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/HammerServiceTest.cs +++ b/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/HammerServiceTest.cs @@ -21,16 +21,10 @@ public HammerServiceTest(SharedTestState fixture) } [Fact] + [SkipOnPlatform(TestPlatforms.Windows, "On Windows, the hammer servicing location is %ProgramFiles%\\coreservicing. Since writing to this location requires administrative privilege, we do not run the test on Windows.")] private void SingleFile_Apps_Are_Serviced() { - if (OperatingSystem.IsWindows()) - { - // On Windows, the hammer servicing location is %ProgramFiles%\coreservicing. - // Since writing to this location requires administrative privilege, we do not run the test on Windows. - // On Unix systems, the servicing location is obtained from the environment variable $CORE_SERVICING. - - return; - } + // On Unix systems, the servicing location is obtained from the environment variable $CORE_SERVICING. var fixture = sharedTestState.TestFixture.Copy(); var servicer = sharedTestState.ServiceFixture.Copy(); 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 216d8873ee454e..e00441d92e0cf1 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 @@ -22,14 +22,11 @@ public AppHostUsedWithSymbolicLinks(AppHostUsedWithSymbolicLinks.SharedTestState } [Theory] + [SkipOnPlatform(TestPlatforms.Windows, "Creating symbolic links requires administrative privilege on Windows, so skip test.")] [InlineData ("a/b/SymlinkToApphost")] [InlineData ("a/SymlinkToApphost")] public void Run_apphost_behind_symlink(string symlinkRelativePath) { - // Creating symbolic links requires administrative privilege on Windows, so skip test. - if (OperatingSystem.IsWindows()) - return; - var fixture = sharedTestState.StandaloneAppFixture_Published .Copy(); @@ -48,16 +45,13 @@ public void Run_apphost_behind_symlink(string symlinkRelativePath) } [Theory] + [SkipOnPlatform(TestPlatforms.Windows, "Creating symbolic links requires administrative privilege on Windows, so skip test.")] [InlineData ("a/b/FirstSymlink", "c/d/SecondSymlink")] [InlineData ("a/b/FirstSymlink", "c/SecondSymlink")] [InlineData ("a/FirstSymlink", "c/d/SecondSymlink")] [InlineData ("a/FirstSymlink", "c/SecondSymlink")] public void Run_apphost_behind_transitive_symlinks(string firstSymlinkRelativePath, string secondSymlinkRelativePath) { - // Creating symbolic links requires administrative privilege on Windows, so skip test. - if (OperatingSystem.IsWindows()) - return; - var fixture = sharedTestState.StandaloneAppFixture_Published .Copy(); @@ -87,12 +81,9 @@ public void Run_apphost_behind_transitive_symlinks(string firstSymlinkRelativePa //[InlineData("a/SymlinkToFrameworkDependentApp")] [Fact(Skip = "Currently failing in OSX with \"No such file or directory\" when running Command.Create. " + "CI failing to use stat on symbolic links on Linux (permission denied).")] + [SkipOnPlatform(TestPlatforms.Windows, "Creating symbolic links requires administrative privilege on Windows, so skip test.")] public void Run_framework_dependent_app_behind_symlink(/*string symlinkRelativePath*/) { - // Creating symbolic links requires administrative privilege on Windows, so skip test. - if (OperatingSystem.IsWindows()) - return; - var symlinkRelativePath = string.Empty; var fixture = sharedTestState.FrameworkDependentAppFixture_Published @@ -116,12 +107,9 @@ public void Run_framework_dependent_app_behind_symlink(/*string symlinkRelativeP [Fact(Skip = "Currently failing in OSX with \"No such file or directory\" when running Command.Create. " + "CI failing to use stat on symbolic links on Linux (permission denied).")] + [SkipOnPlatform(TestPlatforms.Windows, "Creating symbolic links requires administrative privilege on Windows, so skip test.")] public void Run_framework_dependent_app_with_runtime_behind_symlink() { - // Creating symbolic links requires administrative privilege on Windows, so skip test. - if (OperatingSystem.IsWindows()) - return; - var fixture = sharedTestState.FrameworkDependentAppFixture_Published .Copy(); @@ -141,12 +129,9 @@ public void Run_framework_dependent_app_with_runtime_behind_symlink() } [Fact] + [SkipOnPlatform(TestPlatforms.Windows, "Creating symbolic links requires administrative privilege on Windows, so skip test.")] public void Put_app_directory_behind_symlink() { - // Creating symbolic links requires administrative privilege on Windows, so skip test. - if (OperatingSystem.IsWindows()) - return; - var fixture = sharedTestState.StandaloneAppFixture_Published .Copy(); @@ -165,12 +150,9 @@ public void Put_app_directory_behind_symlink() } [Fact] + [SkipOnPlatform(TestPlatforms.Windows, "Creating symbolic links requires administrative privilege on Windows, so skip test.")] public void Put_dotnet_behind_symlink() { - // Creating symbolic links requires administrative privilege on Windows, so skip test. - if (OperatingSystem.IsWindows()) - return; - var fixture = sharedTestState.StandaloneAppFixture_Published .Copy(); @@ -189,12 +171,9 @@ public void Put_dotnet_behind_symlink() } [Fact] + [SkipOnPlatform(TestPlatforms.Windows, "Creating symbolic links requires administrative privilege on Windows, so skip test.")] public void Put_app_directory_behind_symlink_and_use_dotnet() { - // Creating symbolic links requires administrative privilege on Windows, so skip test. - if (OperatingSystem.IsWindows()) - return; - var fixture = sharedTestState.StandaloneAppFixture_Published .Copy(); @@ -213,12 +192,9 @@ public void Put_app_directory_behind_symlink_and_use_dotnet() } [Fact] + [SkipOnPlatform(TestPlatforms.Windows, "Creating symbolic links requires administrative privilege on Windows, so skip test.")] public void Put_app_directory_behind_symlink_and_use_dotnet_run() { - // Creating symbolic links requires administrative privilege on Windows, so skip test. - if (OperatingSystem.IsWindows()) - return; - var fixture = sharedTestState.StandaloneAppFixture_Published .Copy(); @@ -238,14 +214,10 @@ public void Put_app_directory_behind_symlink_and_use_dotnet_run() } [Fact] + // If enabled, this tests will need to set the console code page to output unicode characters: Command.Create("chcp 65001").Execute(); + [SkipOnPlatform(TestPlatforms.Windows, "Creating symbolic links requires administrative privilege on Windows, so skip test.")] public void Put_satellite_assembly_behind_symlink() { - // Creating symbolic links requires administrative privilege on Windows, so skip test. - // If enabled, this tests will need to set the console code page to output unicode characters: - // Command.Create("chcp 65001").Execute(); - if (OperatingSystem.IsWindows()) - return; - var fixture = sharedTestState.StandaloneAppFixture_Localized .Copy();