From 994e2a6c577dbc005dd8e73ac0e30837d24ee9cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Dahlgren?= Date: Tue, 10 Nov 2015 23:24:41 +0100 Subject: [PATCH] Fixed failing tests on Mono Test case unicode characters in escaped format --- .../IndexerSearchTests/SearchDefinitionFixture.cs | 2 +- src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs | 2 +- .../ParserTests/ReleaseGroupParserFixture.cs | 2 +- .../TvTests/ShouldRefreshSeriesFixture.cs | 8 +++++++- src/NzbDrone.Update.Test/ProgramFixture.cs | 8 ++++---- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/NzbDrone.Core.Test/IndexerSearchTests/SearchDefinitionFixture.cs b/src/NzbDrone.Core.Test/IndexerSearchTests/SearchDefinitionFixture.cs index a83f0bc53..4da3587f7 100644 --- a/src/NzbDrone.Core.Test/IndexerSearchTests/SearchDefinitionFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerSearchTests/SearchDefinitionFixture.cs @@ -13,7 +13,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests [TestCase("Hawaii Five-0", Result = "Hawaii+Five+0")] [TestCase("Franklin & Bash", Result = "Franklin+and+Bash")] [TestCase("Chicago P.D.", Result = "Chicago+PD")] - [TestCase("Kourtney And Khloé Take The Hamptons", Result = "Kourtney+And+Khloe+Take+The+Hamptons")] + [TestCase("Kourtney And Khlo\u00E9 Take The Hamptons", Result = "Kourtney+And+Khloe+Take+The+Hamptons")] public string should_replace_some_special_characters(string input) { Subject.SceneTitles = new List { input }; diff --git a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs index c717f03e8..d3d0b9c28 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs @@ -47,7 +47,7 @@ namespace NzbDrone.Core.Test.ParserTests [Test] public void should_remove_accents_from_title() { - const string title = "Carnivàle"; + const string title = "Carniv\u00E0le"; title.CleanSeriesTitle().Should().Be("carnivale"); } diff --git a/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs index fb37f34c5..7f6e1f840 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs @@ -21,7 +21,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("Series Title S01E01 Episode Title", null)] [TestCase("The Colbert Report - 2014-06-02 - Thomas Piketty.mkv", null)] [TestCase("Real Time with Bill Maher S12E17 May 23, 2014.mp4", null)] - [TestCase("Reizen Waes - S01E08 - Transistrië, Zuid-Ossetië en Abchazië SDTV.avi", null)] + [TestCase("Reizen Waes - S01E08 - Transistri\u00EB, Zuid-Osseti\u00EB en Abchazi\u00EB SDTV.avi", null)] [TestCase("Simpsons 10x11 - Wild Barts Cant Be Broken [rl].avi", null)] [TestCase("[ www.Torrenting.com ] - Revenge.S03E14.720p.HDTV.X264-DIMENSION", "DIMENSION")] [TestCase("Seed S02E09 HDTV x264-2HD [eztv]-[rarbg.com]", "2HD")] diff --git a/src/NzbDrone.Core.Test/TvTests/ShouldRefreshSeriesFixture.cs b/src/NzbDrone.Core.Test/TvTests/ShouldRefreshSeriesFixture.cs index fbb97a023..6fb44c09a 100644 --- a/src/NzbDrone.Core.Test/TvTests/ShouldRefreshSeriesFixture.cs +++ b/src/NzbDrone.Core.Test/TvTests/ShouldRefreshSeriesFixture.cs @@ -18,7 +18,6 @@ namespace NzbDrone.Core.Test.TvTests { _series = Builder.CreateNew() .With(v => v.Status == SeriesStatusType.Continuing) - .With(v => v.LastInfoSync == DateTime.UtcNow.AddHours(-12)) .Build(); Mocker.GetMock() @@ -45,6 +44,11 @@ namespace NzbDrone.Core.Test.TvTests _series.LastInfoSync = DateTime.UtcNow.AddDays(-1); } + private void GivenSeriesLastRefreshedHalfADayAgo() + { + _series.LastInfoSync = DateTime.UtcNow.AddHours(-12); + } + private void GivenSeriesLastRefreshedRecently() { _series.LastInfoSync = DateTime.UtcNow.AddHours(-1); @@ -66,6 +70,8 @@ namespace NzbDrone.Core.Test.TvTests [Test] public void should_return_true_if_running_series_last_refreshed_more_than_6_hours_ago() { + GivenSeriesLastRefreshedHalfADayAgo(); + Subject.ShouldRefresh(_series).Should().BeTrue(); } diff --git a/src/NzbDrone.Update.Test/ProgramFixture.cs b/src/NzbDrone.Update.Test/ProgramFixture.cs index b4cc3049a..5d9b7243a 100644 --- a/src/NzbDrone.Update.Test/ProgramFixture.cs +++ b/src/NzbDrone.Update.Test/ProgramFixture.cs @@ -32,18 +32,18 @@ namespace NzbDrone.Update.Test } [Test] - public void should_call_update_with_corret_path() + public void should_call_update_with_correct_path() { - const string ProcessPath = @"C:\NzbDrone\nzbdrone.exe"; + var ProcessPath = @"C:\NzbDrone\nzbdrone.exe".AsOsAgnostic(); Mocker.GetMock().Setup(c => c.GetProcessById(12)) .Returns(new ProcessInfo() { StartPath = ProcessPath }); - Subject.Start(new[] { "12", "" }); + Subject.Start(new[] { "12", "", ProcessPath }); - Mocker.GetMock().Verify(c => c.Start(@"C:\NzbDrone", 12), Times.Once()); + Mocker.GetMock().Verify(c => c.Start(@"C:\NzbDrone".AsOsAgnostic(), 12), Times.Once()); }