Merge pull request #928 from Dahlgren/mono-tests

Fixed tests for Mono
This commit is contained in:
Mark McDowall 2015-11-23 22:50:34 -08:00
commit bc37084ec4
5 changed files with 14 additions and 8 deletions

View File

@ -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<string> { input };

View File

@ -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");
}

View File

@ -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")]

View File

@ -18,7 +18,6 @@ namespace NzbDrone.Core.Test.TvTests
{
_series = Builder<Series>.CreateNew()
.With(v => v.Status == SeriesStatusType.Continuing)
.With(v => v.LastInfoSync == DateTime.UtcNow.AddHours(-12))
.Build();
Mocker.GetMock<IEpisodeService>()
@ -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();
}

View File

@ -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<IProcessProvider>().Setup(c => c.GetProcessById(12))
.Returns(new ProcessInfo() { StartPath = ProcessPath });
Subject.Start(new[] { "12", "" });
Subject.Start(new[] { "12", "", ProcessPath });
Mocker.GetMock<IInstallUpdateService>().Verify(c => c.Start(@"C:\NzbDrone", 12), Times.Once());
Mocker.GetMock<IInstallUpdateService>().Verify(c => c.Start(@"C:\NzbDrone".AsOsAgnostic(), 12), Times.Once());
}