From f65f4ff988f5f1aa0d08d3879af28e2e4604628c Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Mon, 29 Apr 2013 17:39:25 -0700 Subject: [PATCH] trying to fix nunit in teamcity. --- NzbDrone.Common.Test/PathExtensionFixture.cs | 4 ++++ NzbDrone.Test.Common/LoggingTest.cs | 3 ++- NzbDrone.Test.Common/TestBase.cs | 19 ++++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/NzbDrone.Common.Test/PathExtensionFixture.cs b/NzbDrone.Common.Test/PathExtensionFixture.cs index 91471b877..46e018688 100644 --- a/NzbDrone.Common.Test/PathExtensionFixture.cs +++ b/NzbDrone.Common.Test/PathExtensionFixture.cs @@ -33,6 +33,8 @@ namespace NzbDrone.Common.Test [TestCase(@"\\Testserver\Test\file.ext \\", @"\\Testserver\Test\file.ext")] public void Normalize_Path_Windows(string dirty, string clean) { + WindowsOnly(); + var result = dirty.CleanPath(); result.Should().Be(clean); } @@ -46,6 +48,8 @@ namespace NzbDrone.Common.Test [TestCase(@"//CAPITAL//lower// ", @"/CAPITAL/lower")] public void Normalize_Path_Linux(string dirty, string clean) { + LinuxOnly(); + var result = dirty.CleanPath(); result.Should().Be(clean); } diff --git a/NzbDrone.Test.Common/LoggingTest.cs b/NzbDrone.Test.Common/LoggingTest.cs index d5320b008..846a1e845 100644 --- a/NzbDrone.Test.Common/LoggingTest.cs +++ b/NzbDrone.Test.Common/LoggingTest.cs @@ -41,7 +41,8 @@ namespace NzbDrone.Test.Common [TearDown] public void LoggingDownBase() { - if (TestContext.CurrentContext.Result.State == TestState.Failure || TestContext.CurrentContext.Result.State == TestState.Error) + + //if (TestContext.CurrentContext.Result.State == TestState.Failure || TestContext.CurrentContext.Result.State == TestState.Error) { ExceptionVerification.AssertNoUnexcpectedLogs(); } diff --git a/NzbDrone.Test.Common/TestBase.cs b/NzbDrone.Test.Common/TestBase.cs index 10764ce17..ca216d7d3 100644 --- a/NzbDrone.Test.Common/TestBase.cs +++ b/NzbDrone.Test.Common/TestBase.cs @@ -103,7 +103,7 @@ namespace NzbDrone.Test.Common { } - if (TestContext.CurrentContext.Result.State == TestState.Failure || TestContext.CurrentContext.Result.State == TestState.Error) +/* if (TestContext.CurrentContext.Result.State == TestState.Failure || TestContext.CurrentContext.Result.State == TestState.Error) { var testName = TestContext.CurrentContext.Test.Name.ToLower(); @@ -115,6 +115,23 @@ namespace NzbDrone.Test.Common { throw new IgnoreException("linux specific test"); } + }*/ + } + + protected void WindowsOnly() + { + if (EnvironmentProvider.IsLinux) + { + throw new IgnoreException("windows specific test"); + } + } + + + protected void LinuxOnly() + { + if (!EnvironmentProvider.IsLinux) + { + throw new IgnoreException("linux specific test"); } }