mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 20:42:37 +01:00
Merge branch 'markus' into kay.one
Conflicts: NzbDrone.Core.Test/ProviderTests/LogProviderTest.cs
This commit is contained in:
commit
651a63edea
@ -65,6 +65,7 @@ public void ParseTitle_single(string postTitle, string title, int seasonNumber,
|
||||
[TestCase(@"D:\shares\TV Shows\Battlestar Galactica (2003)\Season 2\S02E21.avi", 2, 21)]
|
||||
[TestCase("C:/Test/TV/Chuck.4x05.HDTV.XviD-LOL", 4, 5)]
|
||||
[TestCase(@"P:\TV Shows\House\Season 6\S06E13 - 5 to 9 - 720p BluRay.mkv", 6, 13)]
|
||||
[TestCase(@"S:\TV Drop\House - 10x11 - Title [SDTV]\1011 - Title.avi", 10, 11)]
|
||||
public void PathParse_tests(string path, int season, int episode)
|
||||
{
|
||||
var result = Parser.ParsePath(path);
|
||||
|
@ -266,4 +266,4 @@ public void pagedLogs()
|
||||
logs.TotalItems.Should().Be(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -628,5 +628,51 @@ public void Get_Series_NextAiring_skip_ignored()
|
||||
series.Should().HaveCount(1);
|
||||
series[0].NextAiring.Should().Be(DateTime.Today.AddMonths(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SearchForSeries_should_return_results_that_start_with_query()
|
||||
{
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
var db = MockLib.GetEmptyDatabase();
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
var fakeSeries = Builder<Series>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(e => e.QualityProfileId = fakeQuality.QualityProfileId)
|
||||
.Build();
|
||||
|
||||
db.InsertMany(fakeSeries);
|
||||
db.Insert(fakeQuality);
|
||||
|
||||
//Act
|
||||
var series = mocker.Resolve<SeriesProvider>().SearchForSeries("Titl");
|
||||
|
||||
//Assert
|
||||
series.Should().HaveCount(10);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SearchForSeries_should_not_return_results_that_do_not_start_with_query()
|
||||
{
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
var db = MockLib.GetEmptyDatabase();
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
var fakeSeries = Builder<Series>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(e => e.QualityProfileId = fakeQuality.QualityProfileId)
|
||||
.Build();
|
||||
|
||||
db.InsertMany(fakeSeries);
|
||||
db.Insert(fakeQuality);
|
||||
|
||||
//Act
|
||||
var series = mocker.Resolve<SeriesProvider>().SearchForSeries("NotATitle");
|
||||
|
||||
//Assert
|
||||
series.Should().HaveCount(0);
|
||||
}
|
||||
}
|
||||
} |