fixed some broken tests.
This commit is contained in:
@@ -2,12 +2,12 @@ using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.ReferenceData;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Tv;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
namespace NzbDrone.Core.Test.IndexerSearchTests
|
||||
{
|
||||
public class GetSearchTitleFixture : TestBase
|
||||
public class GetSearchTitleFixture : CoreTest<TestSearch>
|
||||
{
|
||||
private Series _series;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
|
||||
|
||||
private void WithSceneMapping()
|
||||
{
|
||||
Mocker.GetMock<SceneMappingService>()
|
||||
Mocker.GetMock<ISceneMappingService>()
|
||||
.Setup(s => s.GetSceneName(_series.Id, -1))
|
||||
.Returns("Hawaii Five 0 2010");
|
||||
}
|
||||
@@ -30,8 +30,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
|
||||
[Test]
|
||||
public void should_return_series_title_when_there_is_no_scene_mapping()
|
||||
{
|
||||
Mocker.Resolve<TestSearch>().GetSearchTitle(_series, 5)
|
||||
.Should().Be(_series.Title);
|
||||
Subject.GetSearchTitle(_series, 5).Should().Be(_series.Title);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -39,19 +38,17 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
|
||||
{
|
||||
WithSceneMapping();
|
||||
|
||||
Mocker.Resolve<TestSearch>().GetSearchTitle(_series, 5)
|
||||
.Should().Be("Hawaii Five 0 2010");
|
||||
Subject.GetSearchTitle(_series, 5).Should().Be("Hawaii Five 0 2010");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_season_scene_name_when_one_exists()
|
||||
{
|
||||
Mocker.GetMock<SceneMappingService>()
|
||||
Mocker.GetMock<ISceneMappingService>()
|
||||
.Setup(s => s.GetSceneName(_series.Id, 5))
|
||||
.Returns("Hawaii Five 0 2010 - Season 5");
|
||||
|
||||
Mocker.Resolve<TestSearch>().GetSearchTitle(_series, 5)
|
||||
.Should().Be("Hawaii Five 0 2010 - Season 5");
|
||||
Subject.GetSearchTitle(_series, 5).Should().Be("Hawaii Five 0 2010 - Season 5");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -59,8 +56,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
|
||||
{
|
||||
WithSceneMapping();
|
||||
|
||||
Mocker.Resolve<TestSearch>().GetSearchTitle(_series, 5)
|
||||
.Should().Be("Hawaii Five 0 2010");
|
||||
Subject.GetSearchTitle(_series, 5).Should().Be("Hawaii Five 0 2010");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -68,8 +64,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
|
||||
{
|
||||
_series.Title = "Franklin & Bash";
|
||||
|
||||
Mocker.Resolve<TestSearch>().GetSearchTitle(_series, 5)
|
||||
.Should().Be("Franklin and Bash");
|
||||
Subject.GetSearchTitle(_series, 5).Should().Be("Franklin and Bash");
|
||||
}
|
||||
|
||||
[TestCase("Betty White's Off Their Rockers", "Betty Whites Off Their Rockers")]
|
||||
@@ -79,12 +74,11 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
|
||||
{
|
||||
_series.Title = input;
|
||||
|
||||
Mocker.GetMock<SceneMappingService>()
|
||||
Mocker.GetMock<ISceneMappingService>()
|
||||
.Setup(s => s.GetSceneName(_series.Id, -1))
|
||||
.Returns("");
|
||||
|
||||
Mocker.Resolve<TestSearch>().GetSearchTitle(_series, 5)
|
||||
.Should().Be(expected);
|
||||
Subject.GetSearchTitle(_series, 5).Should().Be(expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+24
-7
@@ -1,10 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.IndexerSearch;
|
||||
using NzbDrone.Core.Tv;
|
||||
using NzbDrone.Test.Common;
|
||||
using System.Linq;
|
||||
|
||||
namespace NzbDrone.Core.Test.IndexerSearchTests.PartialSeasonSearchTests
|
||||
{
|
||||
@@ -17,9 +19,9 @@ namespace NzbDrone.Core.Test.IndexerSearchTests.PartialSeasonSearchTests
|
||||
{
|
||||
WithValidIndexers();
|
||||
|
||||
Subject.PerformSearch(_series, new List<Episode> { _episode }, notification)
|
||||
.Should()
|
||||
.HaveCount(20);
|
||||
Subject.PerformSearch(_series, new List<Episode> { _episode }, notification)
|
||||
.Should()
|
||||
.HaveCount(20);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -31,7 +33,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests.PartialSeasonSearchTests
|
||||
.Should()
|
||||
.HaveCount(0);
|
||||
|
||||
ExceptionVerification.ExpectedErrors(4);
|
||||
ExceptionVerification.ExpectedErrors(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -39,14 +41,29 @@ namespace NzbDrone.Core.Test.IndexerSearchTests.PartialSeasonSearchTests
|
||||
{
|
||||
WithValidIndexers();
|
||||
|
||||
Subject.PerformSearch(_series, new List<Episode> { _episode }, notification)
|
||||
.Should()
|
||||
.HaveCount(20);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.All()
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.Build();
|
||||
|
||||
episodes[0].EpisodeNumber = 1;
|
||||
episodes[1].EpisodeNumber = 5;
|
||||
episodes[2].EpisodeNumber = 10;
|
||||
episodes[3].EpisodeNumber = 15;
|
||||
|
||||
|
||||
Subject.PerformSearch(_series, episodes.ToList(), notification)
|
||||
.Should()
|
||||
.HaveCount(40);
|
||||
|
||||
_indexer1.Verify(v => v.FetchPartialSeason(_series.Title, 1, 0), Times.Once());
|
||||
_indexer1.Verify(v => v.FetchPartialSeason(_series.Title, 1, 1), Times.Once());
|
||||
_indexer2.Verify(v => v.FetchPartialSeason(_series.Title, 1, 0), Times.Once());
|
||||
_indexer2.Verify(v => v.FetchPartialSeason(_series.Title, 1, 1), Times.Once());
|
||||
|
||||
_indexer1.Verify(v => v.FetchPartialSeason(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()), Times.Exactly(2));
|
||||
_indexer2.Verify(v => v.FetchPartialSeason(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()), Times.Exactly(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-6
@@ -5,13 +5,14 @@ using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.IndexerSearch;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Tv;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
namespace NzbDrone.Core.Test.IndexerSearchTests.PartialSeasonSearchTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class PartialSeasonSearch_EpisodeMatch : TestBase
|
||||
public class PartialSeasonSearch_EpisodeMatch : CoreTest<PartialSeasonSearch>
|
||||
{
|
||||
private Series _series;
|
||||
private List<Episode> _episodes;
|
||||
@@ -42,17 +43,15 @@ namespace NzbDrone.Core.Test.IndexerSearchTests.PartialSeasonSearchTests
|
||||
[Test]
|
||||
public void should_return_wrongSeason_when_season_does_not_match()
|
||||
{
|
||||
Mocker.Resolve<PartialSeasonSearch>()
|
||||
.IsEpisodeMatch(_series, new { SeasonNumber = 2, Episodes = _episodes }, _episodeParseResult)
|
||||
Subject.IsEpisodeMatch(_series, new { SeasonNumber = 2, Episodes = _episodes }, _episodeParseResult)
|
||||
.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_return_error_when_season_matches()
|
||||
{
|
||||
Mocker.Resolve<PartialSeasonSearch>()
|
||||
.IsEpisodeMatch(_series, new { SeasonNumber = 1, Episodes = _episodes }, _episodeParseResult)
|
||||
.Should().BeFalse();
|
||||
Subject.IsEpisodeMatch(_series, new { SeasonNumber = 1, Episodes = _episodes }, _episodeParseResult)
|
||||
.Should().BeTrue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
|
||||
{
|
||||
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public TestSearch(ISeriesService seriesService, IEpisodeService episodeService, DownloadProvider downloadProvider,
|
||||
public TestSearch(IEpisodeService episodeService, IDownloadProvider downloadProvider,
|
||||
IIndexerService indexerService, ISceneMappingService sceneMappingService,
|
||||
DownloadDirector downloadDirector, ISeriesRepository seriesRepository)
|
||||
IDownloadDirector downloadDirector, ISeriesRepository seriesRepository)
|
||||
: base(seriesRepository, episodeService, downloadProvider, indexerService, sceneMappingService,
|
||||
downloadDirector)
|
||||
{
|
||||
|
||||
@@ -95,22 +95,22 @@ namespace NzbDrone.Core.Test.Indexers
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||
protected override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||
protected override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||
protected override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||
protected override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -153,22 +153,22 @@ namespace NzbDrone.Core.Test.Indexers
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||
protected override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||
protected override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||
protected override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||
protected override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -206,22 +206,22 @@ namespace NzbDrone.Core.Test.Indexers
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||
protected override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||
protected override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||
protected override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||
protected override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -266,22 +266,22 @@ namespace NzbDrone.Core.Test.Indexers
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||
protected override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||
protected override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||
protected override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||
protected override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -319,22 +319,22 @@ namespace NzbDrone.Core.Test.Indexers
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||
protected override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||
protected override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||
protected override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||
protected override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -411,7 +411,8 @@
|
||||
</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>xcopy /s /y "$(SolutionDir)\Libraries\Sqlite\*.*" "$(TargetDir)"</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
Reference in New Issue
Block a user