mirror of
https://github.com/Radarr/Radarr
synced 2025-01-30 19:31:35 +00:00
TopSlider added for local series searching!
Should be easy to add others (would want to have it close other open ones, I think).
This commit is contained in:
parent
08804208cf
commit
745d9d9355
13 changed files with 241 additions and 78 deletions
|
@ -633,5 +633,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);
|
||||
}
|
||||
}
|
||||
} |