From a4ee4a913f985b03752c00795ecb8515f10b7dcf Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 17 Feb 2013 20:13:23 -0800 Subject: [PATCH] ignore WindowsService tests in *nix systems. --- NzbDrone.Common.Test/ServiceProviderTests.cs | 5 +++++ NzbDrone.Common/EnvironmentProvider.cs | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/NzbDrone.Common.Test/ServiceProviderTests.cs b/NzbDrone.Common.Test/ServiceProviderTests.cs index c835816a3..79a69b603 100644 --- a/NzbDrone.Common.Test/ServiceProviderTests.cs +++ b/NzbDrone.Common.Test/ServiceProviderTests.cs @@ -18,6 +18,11 @@ namespace NzbDrone.Common.Test [SetUp] public void Setup() { + if(EnvironmentProvider.IsLinux) + { + throw new IgnoreException("Windows services aren't available in none-windows environments."); + } + serviceProvider = new ServiceProvider(); if (serviceProvider.ServiceExist(TEMP_SERVICE_NAME)) diff --git a/NzbDrone.Common/EnvironmentProvider.cs b/NzbDrone.Common/EnvironmentProvider.cs index 4004de714..90a6f32c5 100644 --- a/NzbDrone.Common/EnvironmentProvider.cs +++ b/NzbDrone.Common/EnvironmentProvider.cs @@ -44,6 +44,15 @@ namespace NzbDrone.Common } } + public static bool IsLinux + { + get + { + int p = (int)Environment.OSVersion.Platform; + return (p == 4) || (p == 6) || (p == 128); + } + } + public static bool IsDebug { get