mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-10 23:29:53 +02:00
Upgraded to NBuilder 3.
This commit is contained in:
parent
e87cdbde44
commit
88b8c053fc
@ -102,9 +102,9 @@ public void series_season_missing_episodes_only_mismatch_count()
|
||||
var notification = new ProgressNotification("Backlog Search Job Test");
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = 1)
|
||||
.Have(e => e.SeasonNumber = 1)
|
||||
.All()
|
||||
.With(e => e.SeriesId = 1)
|
||||
.With(e => e.SeasonNumber = 1)
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
@ -136,9 +136,9 @@ public void series_season_missing_episodes_only()
|
||||
var notification = new ProgressNotification("Backlog Search Job Test");
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = 1)
|
||||
.Have(e => e.SeasonNumber = 1)
|
||||
.All()
|
||||
.With(e => e.SeriesId = 1)
|
||||
.With(e => e.SeasonNumber = 1)
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
@ -170,9 +170,9 @@ public void multiple_missing_episodes()
|
||||
var notification = new ProgressNotification("Backlog Search Job Test");
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(10)
|
||||
.WhereTheFirst(5)
|
||||
.Have(e => e.SeriesId = 1)
|
||||
.Have(e => e.SeasonNumber = 1)
|
||||
.TheFirst(5)
|
||||
.With(e => e.SeriesId = 1)
|
||||
.With(e => e.SeasonNumber = 1)
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
|
@ -60,7 +60,7 @@ public void BannerDownload_some_null_BannerUrl()
|
||||
//Setup
|
||||
var fakeSeries = Builder<Series>.CreateListOfSize(10)
|
||||
.WhereRandom(2)
|
||||
.Have(s => s.BannerUrl = null)
|
||||
.With(s => s.BannerUrl = null)
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
|
@ -48,7 +48,7 @@ public void series_specific_scan_should_scan_series()
|
||||
public void job_with_no_target_should_scan_all_series()
|
||||
{
|
||||
var series = Builder<Series>.CreateListOfSize(2)
|
||||
.WhereTheFirst(1).Has(s => s.SeriesId = 12)
|
||||
.TheFirst(1).Has(s => s.SeriesId = 12)
|
||||
.AndTheNext(1).Has(s => s.SeriesId = 15)
|
||||
.Build();
|
||||
|
||||
@ -76,7 +76,7 @@ public void job_with_no_target_should_scan_all_series()
|
||||
public void failed_scan_should_not_terminated_job()
|
||||
{
|
||||
var series = Builder<Series>.CreateListOfSize(2)
|
||||
.WhereTheFirst(1).Has(s => s.SeriesId = 12)
|
||||
.TheFirst(1).Has(s => s.SeriesId = 12)
|
||||
.AndTheNext(1).Has(s => s.SeriesId = 15)
|
||||
.Build();
|
||||
|
||||
@ -105,7 +105,7 @@ public void failed_scan_should_not_terminated_job()
|
||||
public void job_with_no_target_should_scan_series_with_episodes()
|
||||
{
|
||||
var series = Builder<Series>.CreateListOfSize(2)
|
||||
.WhereTheFirst(1).Has(s => s.SeriesId = 12)
|
||||
.TheFirst(1).Has(s => s.SeriesId = 12)
|
||||
.AndTheNext(1).Has(s => s.SeriesId = 15)
|
||||
.Build();
|
||||
|
||||
|
@ -254,8 +254,8 @@ public void import_new_multi_part_file_episode_has_equal_or_better_quality_than_
|
||||
var fakeSeries = Builder<Series>.CreateNew().Build();
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(e => e.EpisodeFile = Builder<EpisodeFile>.CreateNew()
|
||||
.All()
|
||||
.With(e => e.EpisodeFile = Builder<EpisodeFile>.CreateNew()
|
||||
.With(f => f.Quality = QualityTypes.SDTV)
|
||||
.Build())
|
||||
.Build();
|
||||
@ -289,8 +289,8 @@ public void skip_import_new_multi_part_file_episode_existing_has_better_quality(
|
||||
var fakeSeries = Builder<Series>.CreateNew().Build();
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(e => e.EpisodeFile = Builder<EpisodeFile>.CreateNew()
|
||||
.All()
|
||||
.With(e => e.EpisodeFile = Builder<EpisodeFile>.CreateNew()
|
||||
.With(f => f.Quality = QualityTypes.Bluray720p)
|
||||
.Build())
|
||||
.Build();
|
||||
@ -324,8 +324,8 @@ public void import_new_multi_part_file_episode_replace_two_files()
|
||||
var fakeSeries = Builder<Series>.CreateNew().Build();
|
||||
|
||||
var fakeEpisodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(e => e.Quality = QualityTypes.SDTV)
|
||||
.All()
|
||||
.With(e => e.Quality = QualityTypes.SDTV)
|
||||
.Build();
|
||||
|
||||
var fakeEpisode1 = Builder<Episode>.CreateNew()
|
||||
|
@ -25,9 +25,9 @@ public void Download_report_should_send_to_sab_add_to_history_mark_as_grabbed()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereTheFirst(1).Has(s => s.EpisodeId = 12)
|
||||
.TheFirst(1).Has(s => s.EpisodeId = 12)
|
||||
.AndTheNext(1).Has(s => s.EpisodeId = 99)
|
||||
.WhereAll().Has(s => s.SeriesId = 5)
|
||||
.All().Has(s => s.SeriesId = 5)
|
||||
.Build();
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@ public void GetEpisodes_exists()
|
||||
|
||||
var fakeSeries = Builder<Series>.CreateNew().Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll().Have(e => e.SeriesId = 1).Have(e => e.EpisodeFileId = 0).Build();
|
||||
.All().With(e => e.SeriesId = 1).With(e => e.EpisodeFileId = 0).Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
db.InsertMany(fakeEpisodes);
|
||||
@ -98,7 +98,7 @@ public void GetEpisode_with_EpisodeFile()
|
||||
var fakeSeries = Builder<Series>.CreateNew().Build();
|
||||
var fakeFile = Builder<EpisodeFile>.CreateNew().With(f => f.EpisodeFileId).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll().Have(e => e.SeriesId = 1).WhereTheFirst(1).Have(e => e.EpisodeFileId = 1).Have(e => e.EpisodeFile = fakeFile).Build();
|
||||
.All().With(e => e.SeriesId = 1).TheFirst(1).With(e => e.EpisodeFileId = 1).With(e => e.EpisodeFile = fakeFile).Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
db.InsertMany(fakeEpisodes);
|
||||
@ -124,7 +124,7 @@ public void GetEpisodes_invalid_series()
|
||||
mocker.Resolve<SeriesProvider>();
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll().Have(e => e.SeriesId = 1).Build();
|
||||
.All().With(e => e.SeriesId = 1).Build();
|
||||
|
||||
|
||||
db.InsertMany(fakeEpisodes);
|
||||
@ -154,7 +154,7 @@ public void AttachSeries_list_success()
|
||||
|
||||
var fakeSeries = Builder<Series>.CreateNew().With(s => s.SeriesId = 12).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll().Have(e => e.SeriesId = 12).Build();
|
||||
.All().With(e => e.SeriesId = 12).Build();
|
||||
|
||||
mocker.GetMock<SeriesProvider>()
|
||||
.Setup(c => c.GetSeries(12))
|
||||
@ -225,9 +225,9 @@ public void GetEpisodesBySeason_success()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(10)
|
||||
.WhereAll().Have(c => c.SeriesId = 12)
|
||||
.WhereTheFirst(5).Have(c => c.SeasonNumber = 1)
|
||||
.AndTheRemaining().Have(c => c.SeasonNumber = 2).Build();
|
||||
.All().With(c => c.SeriesId = 12).And(c => c.SeasonNumber = 2)
|
||||
.TheFirst(5).With(c => c.SeasonNumber = 1)
|
||||
.Build();
|
||||
|
||||
var db = MockLib.GetEmptyDatabase();
|
||||
var mocker = new AutoMoqer();
|
||||
@ -254,8 +254,8 @@ public void RefreshEpisodeInfo_emptyRepo()
|
||||
var fakeEpisodes = Builder<TvdbSeries>.CreateNew().With(
|
||||
c => c.Episodes =
|
||||
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
||||
WhereAll()
|
||||
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
All()
|
||||
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
.Build())
|
||||
).With(c => c.Id = seriesId).Build();
|
||||
|
||||
@ -293,10 +293,9 @@ public void RefreshEpisodeInfo_should_set_older_than_1900_to_null()
|
||||
var fakeEpisodes = Builder<TvdbSeries>.CreateNew().With(
|
||||
c => c.Episodes =
|
||||
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(10).
|
||||
WhereAll()
|
||||
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
.WhereTheFirst(7).Have(e => e.FirstAired = new DateTime(1800, 1, 1))
|
||||
.AndTheRemaining().Have(e => e.FirstAired = DateTime.Now)
|
||||
All()
|
||||
.With(l => l.Language = new TvdbLanguage(0, "eng", "a")).And(e => e.FirstAired = DateTime.Now)
|
||||
.TheFirst(7).With(e => e.FirstAired = new DateTime(1800, 1, 1))
|
||||
.Build())
|
||||
).With(c => c.Id = seriesId).Build();
|
||||
|
||||
@ -336,9 +335,9 @@ public void RefreshEpisodeInfo_ignore_episode_zero()
|
||||
var fakeEpisodes = Builder<TvdbSeries>.CreateNew().With(
|
||||
c => c.Episodes =
|
||||
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
||||
WhereAll()
|
||||
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
.WhereTheFirst(1)
|
||||
All()
|
||||
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
.TheFirst(1)
|
||||
.Has(e => e.EpisodeNumber = 0)
|
||||
.Has(e => e.SeasonNumber = 15)
|
||||
.Build())
|
||||
@ -447,7 +446,7 @@ public void should_try_to_get_existing_episode_using_tvdbid_first()
|
||||
.With(c => c.Id = seriesId)
|
||||
.With(c => c.Episodes = new List<TvdbEpisode>(
|
||||
Builder<TvdbEpisode>.CreateListOfSize(1)
|
||||
.WhereAll().Have(g => g.Id = 99)
|
||||
.All().With(g => g.Id = 99)
|
||||
.Build())
|
||||
)
|
||||
.Build();
|
||||
@ -565,10 +564,10 @@ public void IsSeasonIgnored_should_return_true_if_all_episodes_ignored()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.Ignored = true)
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 2)
|
||||
.All()
|
||||
.With(c => c.Ignored = true)
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 2)
|
||||
.Build();
|
||||
|
||||
episodes.ToList().ForEach(c => db.Insert(c));
|
||||
@ -588,10 +587,10 @@ public void IsSeasonIgnored_should_return_false_if_none_of_episodes_are_ignored(
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.Ignored = false)
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 2)
|
||||
.All()
|
||||
.With(c => c.Ignored = false)
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 2)
|
||||
.Build();
|
||||
|
||||
episodes.ToList().ForEach(c => db.Insert(c));
|
||||
@ -611,10 +610,10 @@ public void IsSeasonIgnored_should_return_false_if_some_of_episodes_are_ignored(
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 2)
|
||||
.Have(c => c.Ignored = true)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 2)
|
||||
.With(c => c.Ignored = true)
|
||||
.Build();
|
||||
|
||||
episodes[2].Ignored = false;
|
||||
@ -637,10 +636,10 @@ public void IsSeasonIgnored_should_return_false_if_zero_episodes_in_db_for_seaso
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 3)
|
||||
.Have(c => c.Ignored = true)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 3)
|
||||
.With(c => c.Ignored = true)
|
||||
.Build();
|
||||
|
||||
episodes.ToList().ForEach(c => db.Insert(c));
|
||||
@ -660,10 +659,10 @@ public void IsSeasonIgnored_should_return_true_if_zero_episodes_in_db_for_season
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 3)
|
||||
.Have(c => c.Ignored = true)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 3)
|
||||
.With(c => c.Ignored = true)
|
||||
.Build();
|
||||
|
||||
episodes.ToList().ForEach(c => db.Insert(c));
|
||||
@ -683,10 +682,10 @@ public void IsSeasonIgnored_should_return_false_if_zero_episodes_in_db_for_seaso
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 3)
|
||||
.Have(c => c.Ignored = false)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 3)
|
||||
.With(c => c.Ignored = false)
|
||||
.Build();
|
||||
|
||||
episodes.ToList().ForEach(c => db.Insert(c));
|
||||
@ -734,10 +733,10 @@ public void IsSeasonIgnored_should_return_false_if_season_zero_is_not_ignored()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 0)
|
||||
.Have(c => c.Ignored = false)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 0)
|
||||
.With(c => c.Ignored = false)
|
||||
.Build();
|
||||
|
||||
episodes.ToList().ForEach(c => db.Insert(c));
|
||||
@ -803,7 +802,7 @@ public void GetEpisode_by_Season_Episode_with_EpisodeFile()
|
||||
var fakeSeries = Builder<Series>.CreateNew().Build();
|
||||
var fakeFile = Builder<EpisodeFile>.CreateNew().With(f => f.EpisodeFileId).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll().Have(e => e.SeriesId = 1).WhereTheFirst(1).Have(e => e.EpisodeFileId = 1).Have(e => e.EpisodeFile = fakeFile).Build();
|
||||
.All().With(e => e.SeriesId = 1).TheFirst(1).With(e => e.EpisodeFileId = 1).With(e => e.EpisodeFile = fakeFile).Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
db.InsertMany(fakeEpisodes);
|
||||
@ -827,7 +826,7 @@ public void GetEpisode_by_Season_Episode_without_EpisodeFile()
|
||||
|
||||
var fakeSeries = Builder<Series>.CreateNew().Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll().Have(e => e.SeriesId = 1).WhereTheFirst(1).Have(e => e.EpisodeFileId = 0).Build();
|
||||
.All().With(e => e.SeriesId = 1).TheFirst(1).With(e => e.EpisodeFileId = 0).Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
db.InsertMany(fakeEpisodes);
|
||||
@ -851,7 +850,7 @@ public void GetEpisode_by_AirDate_with_EpisodeFile()
|
||||
var fakeSeries = Builder<Series>.CreateNew().Build();
|
||||
var fakeFile = Builder<EpisodeFile>.CreateNew().With(f => f.EpisodeFileId).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll().Have(e => e.SeriesId = 1).WhereTheFirst(1).Have(e => e.EpisodeFileId = 1).Have(e => e.EpisodeFile = fakeFile).Build();
|
||||
.All().With(e => e.SeriesId = 1).TheFirst(1).With(e => e.EpisodeFileId = 1).With(e => e.EpisodeFile = fakeFile).Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
db.InsertMany(fakeEpisodes);
|
||||
@ -875,7 +874,7 @@ public void GetEpisode_by_AirDate_without_EpisodeFile()
|
||||
|
||||
var fakeSeries = Builder<Series>.CreateNew().Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll().Have(e => e.SeriesId = 1).WhereTheFirst(1).Have(e => e.EpisodeFileId = 0).Build();
|
||||
.All().With(e => e.SeriesId = 1).TheFirst(1).With(e => e.EpisodeFileId = 0).Build();
|
||||
|
||||
db.InsertMany(fakeEpisodes);
|
||||
db.Insert(fakeSeries);
|
||||
@ -897,7 +896,7 @@ public void MarkEpisodeAsFetched()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll().Have(e => e.GrabDate = null)
|
||||
.All().With(e => e.GrabDate = null)
|
||||
.Build();
|
||||
|
||||
db.InsertMany(fakeEpisodes);
|
||||
@ -921,10 +920,10 @@ public void AddEpisode_episode_is_ignored_when_full_season_is_ignored()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.Ignored = true)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.Ignored = true)
|
||||
.Build().ToList();
|
||||
|
||||
episodes.ForEach(c => db.Insert(c));
|
||||
@ -957,10 +956,10 @@ public void AddEpisode_episode_is_not_ignored_when_full_season_is_not_ignored()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.Ignored = false)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.Ignored = false)
|
||||
.Build().ToList();
|
||||
|
||||
episodes.ForEach(c => db.Insert(c));
|
||||
@ -993,14 +992,13 @@ public void AddEpisode_episode_is_not_ignored_when_not_full_season_is_not_ignore
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.WhereTheFirst(2)
|
||||
.Have(c => c.Ignored = false)
|
||||
.AndTheRemaining()
|
||||
.Have(c => c.Ignored = true)
|
||||
.Build().ToList();
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.And(c => c.SeasonNumber = 1)
|
||||
.And(c => c.Ignored = true)
|
||||
.TheFirst(2)
|
||||
.With(c => c.Ignored = false)
|
||||
.Build().ToList();
|
||||
|
||||
episodes.ForEach(c => db.Insert(c));
|
||||
|
||||
@ -1032,10 +1030,10 @@ public void IgnoreEpisode_Ignore()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.Ignored = false)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.Ignored = false)
|
||||
.Build().ToList();
|
||||
|
||||
episodes.ForEach(c => db.Insert(c));
|
||||
@ -1060,10 +1058,10 @@ public void IgnoreEpisode_RemoveIgnore()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.Ignored = true)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.Ignored = true)
|
||||
.Build().ToList();
|
||||
|
||||
episodes.ForEach(c => db.Insert(c));
|
||||
@ -1088,10 +1086,10 @@ public void IgnoreSeason_Ignore()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.Ignored = false)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.Ignored = false)
|
||||
.Build().ToList();
|
||||
|
||||
episodes.ForEach(c => db.Insert(c));
|
||||
@ -1116,10 +1114,10 @@ public void IgnoreSeason_RemoveIgnore()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.Ignored = true)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.Ignored = true)
|
||||
.Build().ToList();
|
||||
|
||||
episodes.ForEach(c => db.Insert(c));
|
||||
@ -1144,13 +1142,12 @@ public void IgnoreSeason_Ignore_Half()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.WhereTheFirst(2)
|
||||
.Have(c => c.Ignored = false)
|
||||
.AndTheRemaining()
|
||||
.Have(c => c.Ignored = true)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.Ignored = true)
|
||||
.TheFirst(2)
|
||||
.With(c => c.Ignored = false)
|
||||
.Build().ToList();
|
||||
|
||||
episodes.ForEach(c => db.Insert(c));
|
||||
@ -1179,27 +1176,25 @@ public void EpisodesWithoutFiles_no_specials()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.AirDate = DateTime.Today.AddDays(-4))
|
||||
.Have(c => c.Ignored = true)
|
||||
.WhereTheFirst(2)
|
||||
.Have(c => c.EpisodeFileId = 0)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.AirDate = DateTime.Today.AddDays(-4))
|
||||
.With(c => c.Ignored = true)
|
||||
.TheFirst(2)
|
||||
.With(c => c.EpisodeFileId = 0)
|
||||
.WhereSection(1, 2)
|
||||
.Have(c => c.Ignored = false)
|
||||
.With(c => c.Ignored = false)
|
||||
.Build().ToList();
|
||||
|
||||
var specials = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 0)
|
||||
.Have(c => c.AirDate = DateTime.Today.AddDays(-4))
|
||||
.Have(c => c.EpisodeFileId = 0)
|
||||
.WhereTheFirst(1)
|
||||
.Have(c => c.Ignored = true)
|
||||
.AndTheRemaining()
|
||||
.Have(c => c.Ignored = false)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 0)
|
||||
.With(c => c.AirDate = DateTime.Today.AddDays(-4))
|
||||
.With(c => c.EpisodeFileId = 0)
|
||||
.With(c => c.Ignored = false)
|
||||
.TheFirst(1).With(c => c.Ignored = true)
|
||||
.Build().ToList();
|
||||
|
||||
db.Insert(series);
|
||||
@ -1228,27 +1223,26 @@ public void EpisodesWithoutFiles_with_specials()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.AirDate = DateTime.Today.AddDays(-4))
|
||||
.Have(c => c.Ignored = true)
|
||||
.WhereTheFirst(2)
|
||||
.Have(c => c.EpisodeFileId = 0)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.AirDate = DateTime.Today.AddDays(-4))
|
||||
.With(c => c.Ignored = true)
|
||||
.TheFirst(2)
|
||||
.With(c => c.EpisodeFileId = 0)
|
||||
.WhereSection(1, 2)
|
||||
.Have(c => c.Ignored = false)
|
||||
.With(c => c.Ignored = false)
|
||||
.Build().ToList();
|
||||
|
||||
var specials = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 0)
|
||||
.Have(c => c.AirDate = DateTime.Today.AddDays(-4))
|
||||
.Have(c => c.EpisodeFileId = 0)
|
||||
.WhereTheFirst(1)
|
||||
.Have(c => c.Ignored = true)
|
||||
.AndTheRemaining()
|
||||
.Have(c => c.Ignored = false)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 0)
|
||||
.With(c => c.AirDate = DateTime.Today.AddDays(-4))
|
||||
.With(c => c.EpisodeFileId = 0)
|
||||
.With(c => c.Ignored = false)
|
||||
.TheFirst(1)
|
||||
.With(c => c.Ignored = true)
|
||||
.Build().ToList();
|
||||
|
||||
db.Insert(series);
|
||||
@ -1281,13 +1275,13 @@ public void EpisodesWithFiles_success()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.AirDate = DateTime.Today.AddDays(-4))
|
||||
.Have(c => c.Ignored = true)
|
||||
.Have(c => c.EpisodeFile = episodeFile)
|
||||
.Have(c => c.EpisodeFileId = episodeFile.EpisodeFileId)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.AirDate = DateTime.Today.AddDays(-4))
|
||||
.With(c => c.Ignored = true)
|
||||
.With(c => c.EpisodeFile = episodeFile)
|
||||
.With(c => c.EpisodeFileId = episodeFile.EpisodeFileId)
|
||||
.Build().ToList();
|
||||
|
||||
db.Insert(series);
|
||||
@ -1323,12 +1317,12 @@ public void EpisodesWithFiles_no_files()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.AirDate = DateTime.Today.AddDays(-4))
|
||||
.Have(c => c.Ignored = true)
|
||||
.Have(c => c.EpisodeFileId = 0)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.AirDate = DateTime.Today.AddDays(-4))
|
||||
.With(c => c.Ignored = true)
|
||||
.With(c => c.EpisodeFileId = 0)
|
||||
.Build().ToList();
|
||||
|
||||
db.Insert(series);
|
||||
@ -1355,10 +1349,10 @@ public void GetEpisodesByFileId_multi_episodes()
|
||||
.Build();
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.EpisodeFileId = 12345)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.EpisodeFileId = 12345)
|
||||
.Build();
|
||||
|
||||
db.Insert(series);
|
||||
@ -1409,9 +1403,9 @@ public void IsFirstOrLastEpisodeInSeason_false()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.Build();
|
||||
|
||||
db.InsertMany(fakeEpisodes);
|
||||
@ -1431,9 +1425,9 @@ public void IsFirstOrLastEpisodeInSeason_true_first()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.Build();
|
||||
|
||||
db.InsertMany(fakeEpisodes);
|
||||
@ -1453,9 +1447,9 @@ public void IsFirstOrLastEpisodeInSeason_true_last()
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 10)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 10)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.Build();
|
||||
|
||||
db.InsertMany(fakeEpisodes);
|
||||
@ -1485,10 +1479,10 @@ public void SetPostDownloadStatus(string folderName, PostDownloadStatusType post
|
||||
.Build();
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(episodeCount)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 12345)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 12345)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
|
||||
.Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
@ -1519,10 +1513,10 @@ public void SetPostDownloadStatus_Invalid_EpisodeId()
|
||||
.Build();
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(1)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 12345)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 12345)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
|
||||
.Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
@ -1531,7 +1525,7 @@ public void SetPostDownloadStatus_Invalid_EpisodeId()
|
||||
mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("officeus")).Returns(fakeSeries);
|
||||
|
||||
//Act
|
||||
mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>{300}, postDownloadStatus);
|
||||
mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int> { 300 }, postDownloadStatus);
|
||||
|
||||
//Assert
|
||||
var result = db.Fetch<Episode>();
|
||||
|
@ -31,8 +31,8 @@ public void Delete_None_Valid_TvDbEpisodeId()
|
||||
var tvDbSeries = Builder<TvdbSeries>.CreateNew().With(
|
||||
c => c.Episodes =
|
||||
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
||||
WhereAll()
|
||||
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
All()
|
||||
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
.Build())
|
||||
).With(c => c.Id = seriesId).Build();
|
||||
|
||||
@ -71,8 +71,8 @@ public void Delete_None_TvDbEpisodeId_is_zero()
|
||||
var tvDbSeries = Builder<TvdbSeries>.CreateNew().With(
|
||||
c => c.Episodes =
|
||||
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
||||
WhereAll()
|
||||
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
All()
|
||||
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
.Build())
|
||||
).With(c => c.Id = seriesId).Build();
|
||||
|
||||
@ -111,8 +111,8 @@ public void Delete_None_TvDbEpisodeId_is_null()
|
||||
var tvDbSeries = Builder<TvdbSeries>.CreateNew().With(
|
||||
c => c.Episodes =
|
||||
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
||||
WhereAll()
|
||||
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
All()
|
||||
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
.Build())
|
||||
).With(c => c.Id = seriesId).Build();
|
||||
|
||||
@ -151,8 +151,8 @@ public void Delete_TvDbId()
|
||||
var tvDbSeries = Builder<TvdbSeries>.CreateNew().With(
|
||||
c => c.Episodes =
|
||||
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
||||
WhereAll()
|
||||
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
All()
|
||||
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
.Build())
|
||||
).With(c => c.Id = seriesId).Build();
|
||||
|
||||
@ -194,8 +194,8 @@ public void Delete_TvDbId_multiple_series()
|
||||
var tvDbSeries = Builder<TvdbSeries>.CreateNew().With(
|
||||
c => c.Episodes =
|
||||
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
||||
WhereAll()
|
||||
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
All()
|
||||
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
.Build())
|
||||
).With(c => c.Id = seriesId).Build();
|
||||
|
||||
|
@ -45,7 +45,7 @@ public void AllItemsWithRelationships()
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(10).Build();
|
||||
|
||||
var historyItems = Builder<History>.CreateListOfSize(10).WhereTheFirst(5).Have(h => h.SeriesId = seriesOne.SeriesId).WhereTheLast(5).Have(h => h.SeriesId = seriesTwo.SeriesId).Build();
|
||||
var historyItems = Builder<History>.CreateListOfSize(10).TheFirst(5).With(h => h.SeriesId = seriesOne.SeriesId).WhereTheLast(5).With(h => h.SeriesId = seriesTwo.SeriesId).Build();
|
||||
|
||||
var mocker = new AutoMoqer();
|
||||
var db = MockLib.GetEmptyDatabase();
|
||||
@ -95,8 +95,8 @@ public void Trim_Items()
|
||||
{
|
||||
//Setup
|
||||
var historyItem = Builder<History>.CreateListOfSize(20)
|
||||
.WhereTheFirst(10).Have(c => c.Date = DateTime.Now)
|
||||
.AndTheNext(10).Have(c => c.Date = DateTime.Now.AddDays(-31))
|
||||
.TheFirst(10).With(c => c.Date = DateTime.Now)
|
||||
.AndTheNext(10).With(c => c.Date = DateTime.Now.AddDays(-31))
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer();
|
||||
|
@ -21,8 +21,8 @@ public class ImportNewSeriesJobTest : TestBase
|
||||
public void import_new_series_succesfull()
|
||||
{
|
||||
var series = Builder<Series>.CreateListOfSize(2)
|
||||
.WhereAll().Have(s => s.LastInfoSync = null)
|
||||
.WhereTheFirst(1).Has(s => s.SeriesId = 12)
|
||||
.All().With(s => s.LastInfoSync = null)
|
||||
.TheFirst(1).Has(s => s.SeriesId = 12)
|
||||
.AndTheNext(1).Has(s => s.SeriesId = 15)
|
||||
.Build();
|
||||
|
||||
@ -86,8 +86,8 @@ public void import_new_series_succesfull()
|
||||
public void failed_import_should_not_be_stuck_in_loop()
|
||||
{
|
||||
var series = Builder<Series>.CreateListOfSize(2)
|
||||
.WhereAll().Have(s => s.LastInfoSync = null)
|
||||
.WhereTheFirst(1).Has(s => s.SeriesId = 12)
|
||||
.All().With(s => s.LastInfoSync = null)
|
||||
.TheFirst(1).Has(s => s.SeriesId = 12)
|
||||
.AndTheNext(1).Has(s => s.SeriesId = 15)
|
||||
.Build();
|
||||
|
||||
@ -163,7 +163,7 @@ public void AutoIgnoreSeason_existing_should_not_ignore_currentseason()
|
||||
int seriesId = 12;
|
||||
|
||||
var episodesFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.WhereAll().Have(e => e.SeriesId = seriesId)
|
||||
.All().With(e => e.SeriesId = seriesId)
|
||||
.Build();
|
||||
|
||||
episodesFiles[0].SeasonNumber = 0;
|
||||
@ -190,7 +190,7 @@ public void AutoIgnoreSeason_existing_should_ignore_seasons_with_no_file()
|
||||
int seriesId = 12;
|
||||
|
||||
var episodesFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.WhereAll().Have(e => e.SeriesId = seriesId)
|
||||
.All().With(e => e.SeriesId = seriesId)
|
||||
.Build();
|
||||
|
||||
episodesFiles[0].SeasonNumber = 1;
|
||||
|
@ -28,10 +28,10 @@ public class MediaFileProviderTests : TestBase
|
||||
public void get_series_files()
|
||||
{
|
||||
var firstSeriesFiles = Builder<EpisodeFile>.CreateListOfSize(10)
|
||||
.WhereAll().Have(s => s.SeriesId = 12).Build();
|
||||
.All().With(s => s.SeriesId = 12).Build();
|
||||
|
||||
var secondSeriesFiles = Builder<EpisodeFile>.CreateListOfSize(10)
|
||||
.WhereAll().Have(s => s.SeriesId = 20).Build();
|
||||
.All().With(s => s.SeriesId = 20).Build();
|
||||
|
||||
var mocker = new AutoMoqer();
|
||||
|
||||
@ -53,15 +53,15 @@ public void get_series_files()
|
||||
public void get_season_files()
|
||||
{
|
||||
var firstSeriesFiles = Builder<EpisodeFile>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(s => s.SeriesId = 12)
|
||||
.Have(s => s.SeasonNumber = 1)
|
||||
.All()
|
||||
.With(s => s.SeriesId = 12)
|
||||
.With(s => s.SeasonNumber = 1)
|
||||
.Build();
|
||||
|
||||
var secondSeriesFiles = Builder<EpisodeFile>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(s => s.SeriesId = 12)
|
||||
.Have(s => s.SeasonNumber = 2)
|
||||
.All()
|
||||
.With(s => s.SeriesId = 12)
|
||||
.With(s => s.SeasonNumber = 2)
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer();
|
||||
|
@ -27,7 +27,7 @@ public void no_misnamed_files()
|
||||
.Build();
|
||||
|
||||
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.WhereTheFirst(1)
|
||||
.TheFirst(1)
|
||||
.Has(f => f.EpisodeFileId = 1)
|
||||
.Has(f => f.Path = @"C:\Test\Title1.avi")
|
||||
.AndTheNext(1)
|
||||
@ -36,9 +36,9 @@ public void no_misnamed_files()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(e => e.Series = series)
|
||||
.WhereTheFirst(1)
|
||||
.All()
|
||||
.With(e => e.Series = series)
|
||||
.TheFirst(1)
|
||||
.Has(e => e.EpisodeFileId = 1)
|
||||
.Has(e => e.EpisodeFile = episodeFiles[0])
|
||||
.AndTheNext(1)
|
||||
@ -76,7 +76,7 @@ public void all_misnamed_files()
|
||||
.Build();
|
||||
|
||||
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.WhereTheFirst(1)
|
||||
.TheFirst(1)
|
||||
.Has(f => f.EpisodeFileId = 1)
|
||||
.Has(f => f.Path = @"C:\Test\Title1.avi")
|
||||
.AndTheNext(1)
|
||||
@ -85,9 +85,9 @@ public void all_misnamed_files()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(e => e.Series = series)
|
||||
.WhereTheFirst(1)
|
||||
.All()
|
||||
.With(e => e.Series = series)
|
||||
.TheFirst(1)
|
||||
.Has(e => e.EpisodeFileId = 1)
|
||||
.Has(e => e.EpisodeFile = episodeFiles[0])
|
||||
.AndTheNext(1)
|
||||
@ -125,7 +125,7 @@ public void one_misnamed_file()
|
||||
.Build();
|
||||
|
||||
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.WhereTheFirst(1)
|
||||
.TheFirst(1)
|
||||
.Has(f => f.EpisodeFileId = 1)
|
||||
.Has(f => f.Path = @"C:\Test\Title1.avi")
|
||||
.AndTheNext(1)
|
||||
@ -134,9 +134,9 @@ public void one_misnamed_file()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(e => e.Series = series)
|
||||
.WhereTheFirst(1)
|
||||
.All()
|
||||
.With(e => e.Series = series)
|
||||
.TheFirst(1)
|
||||
.Has(e => e.EpisodeFileId = 1)
|
||||
.Has(e => e.EpisodeFile = episodeFiles[0])
|
||||
.AndTheNext(1)
|
||||
@ -176,7 +176,7 @@ public void misnamed_multi_episode_file()
|
||||
.Build();
|
||||
|
||||
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.WhereTheFirst(1)
|
||||
.TheFirst(1)
|
||||
.Has(f => f.EpisodeFileId = 1)
|
||||
.Has(f => f.Path = @"C:\Test\Title1.avi")
|
||||
.AndTheNext(1)
|
||||
@ -185,9 +185,9 @@ public void misnamed_multi_episode_file()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(3)
|
||||
.WhereAll()
|
||||
.Have(e => e.Series = series)
|
||||
.WhereTheFirst(2)
|
||||
.All()
|
||||
.With(e => e.Series = series)
|
||||
.TheFirst(2)
|
||||
.Has(e => e.EpisodeFileId = 1)
|
||||
.Has(e => e.EpisodeFile = episodeFiles[0])
|
||||
.AndTheNext(1)
|
||||
@ -227,7 +227,7 @@ public void no_misnamed_multi_episode_file()
|
||||
.Build();
|
||||
|
||||
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.WhereTheFirst(1)
|
||||
.TheFirst(1)
|
||||
.Has(f => f.EpisodeFileId = 1)
|
||||
.Has(f => f.Path = @"C:\Test\Title1.avi")
|
||||
.AndTheNext(1)
|
||||
@ -236,9 +236,9 @@ public void no_misnamed_multi_episode_file()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(3)
|
||||
.WhereAll()
|
||||
.Have(e => e.Series = series)
|
||||
.WhereTheFirst(2)
|
||||
.All()
|
||||
.With(e => e.Series = series)
|
||||
.TheFirst(2)
|
||||
.Has(e => e.EpisodeFileId = 1)
|
||||
.Has(e => e.EpisodeFile = episodeFiles[0])
|
||||
.AndTheNext(1)
|
||||
|
@ -36,8 +36,9 @@
|
||||
<Reference Include="Accessibility">
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="FizzWare.NBuilder">
|
||||
<HintPath>..\packages\NBuilder.2.3.0.0\lib\FizzWare.NBuilder.dll</HintPath>
|
||||
<Reference Include="FizzWare.NBuilder, Version=3.0.1.0, Culture=neutral, PublicKeyToken=5651b03e12e42c12, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\NBuilder.3.0.1\lib\FizzWare.NBuilder.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FluentAssertions">
|
||||
<HintPath>..\Libraries\FluentAssertions.dll</HintPath>
|
||||
|
@ -41,10 +41,10 @@ public void ProcessFailedOrUnpackingDownload(string folderName, PostDownloadStat
|
||||
.Build();
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(episodeCount)
|
||||
.WhereAll()
|
||||
.Have(c => c.SeriesId = 12345)
|
||||
.Have(c => c.SeasonNumber = 1)
|
||||
.Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
|
||||
.All()
|
||||
.With(c => c.SeriesId = 12345)
|
||||
.With(c => c.SeasonNumber = 1)
|
||||
.With(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
|
||||
.Build();
|
||||
|
||||
var expectedEpisodesNumbers = fakeEpisodes.Select(e => e.EpisodeId).ToList();
|
||||
@ -200,8 +200,8 @@ public void ProcessDownload_Unknown_Error()
|
||||
.Build();
|
||||
|
||||
var fakeEpisodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(f => f.SeriesId = fakeSeries.SeriesId)
|
||||
.All()
|
||||
.With(f => f.SeriesId = fakeSeries.SeriesId)
|
||||
.Build().ToList();
|
||||
|
||||
//Act
|
||||
@ -230,8 +230,8 @@ public void ProcessDownload_Success()
|
||||
.Build();
|
||||
|
||||
var fakeEpisodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(f => f.SeriesId = fakeSeries.SeriesId)
|
||||
.All()
|
||||
.With(f => f.SeriesId = fakeSeries.SeriesId)
|
||||
.Build().ToList();
|
||||
|
||||
//Act
|
||||
|
@ -55,7 +55,7 @@ public void processResults_ParseResult_should_return_after_match()
|
||||
public void processResults_higher_quality_should_be_called_first()
|
||||
{
|
||||
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(10)
|
||||
.WhereAll().Have(c => c.Quality = new Quality(QualityTypes.DVD, true))
|
||||
.All().With(c => c.Quality = new Quality(QualityTypes.DVD, true))
|
||||
.WhereRandom(1).Has(c => c.Quality = new Quality(QualityTypes.Bluray1080p, true))
|
||||
.Build();
|
||||
|
||||
@ -91,7 +91,7 @@ public void processResults_higher_quality_should_be_called_first()
|
||||
public void processResults_when_same_quality_proper_should_be_called_first()
|
||||
{
|
||||
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(20)
|
||||
.WhereAll().Have(c => c.Quality = new Quality(QualityTypes.DVD, false))
|
||||
.All().With(c => c.Quality = new Quality(QualityTypes.DVD, false))
|
||||
.WhereRandom(1).Has(c => c.Quality = new Quality(QualityTypes.DVD, true))
|
||||
.Build();
|
||||
|
||||
|
@ -30,16 +30,16 @@ public void SeasonPartialSearch_season_success()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll()
|
||||
.Have(e => e.Series = series)
|
||||
.Have(e => e.SeriesId = 1)
|
||||
.Have(e => e.SeasonNumber = 1)
|
||||
.Have(e => e.Ignored = false)
|
||||
.All()
|
||||
.With(e => e.Series = series)
|
||||
.With(e => e.SeriesId = 1)
|
||||
.With(e => e.SeasonNumber = 1)
|
||||
.With(e => e.Ignored = false)
|
||||
.Build();
|
||||
|
||||
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(e => e.EpisodeNumbers = Builder<int>.CreateListOfSize(2).Build().ToList())
|
||||
.All()
|
||||
.With(e => e.EpisodeNumbers = Builder<int>.CreateListOfSize(2).Build().ToList())
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
@ -93,16 +93,16 @@ public void SeasonPartialSearch_season_no_results()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll()
|
||||
.Have(e => e.Series = series)
|
||||
.Have(e => e.SeriesId = 1)
|
||||
.Have(e => e.SeasonNumber = 1)
|
||||
.Have(e => e.Ignored = false)
|
||||
.All()
|
||||
.With(e => e.Series = series)
|
||||
.With(e => e.SeriesId = 1)
|
||||
.With(e => e.SeasonNumber = 1)
|
||||
.With(e => e.Ignored = false)
|
||||
.Build();
|
||||
|
||||
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(e => e.EpisodeNumbers = Builder<int>.CreateListOfSize(2).Build().ToList())
|
||||
.All()
|
||||
.With(e => e.EpisodeNumbers = Builder<int>.CreateListOfSize(2).Build().ToList())
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
@ -150,9 +150,9 @@ public void ProcessPartialSeasonSearchResults_success()
|
||||
.Build();
|
||||
|
||||
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
|
||||
.WhereAll()
|
||||
.Have(e => e.EpisodeNumbers = Builder<int>.CreateListOfSize(2).Build().ToList())
|
||||
.Have(e => e.Series = series)
|
||||
.All()
|
||||
.With(e => e.EpisodeNumbers = Builder<int>.CreateListOfSize(2).Build().ToList())
|
||||
.With(e => e.Series = series)
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
@ -184,7 +184,7 @@ public void ProcessPartialSeasonSearchResults_failure()
|
||||
.Build();
|
||||
|
||||
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
|
||||
.WhereTheFirst(1)
|
||||
.TheFirst(1)
|
||||
.Has(p => p.CleanTitle = "title")
|
||||
.Has(p => p.SeasonNumber = 1)
|
||||
.Has(p => p.FullSeason = true)
|
||||
|
@ -30,15 +30,15 @@ public void SeasonSearch_season_success()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll()
|
||||
.Have(e => e.Series = series)
|
||||
.Have(e => e.SeriesId = 1)
|
||||
.Have(e => e.SeasonNumber = 1)
|
||||
.Have(e => e.Ignored = false)
|
||||
.All()
|
||||
.With(e => e.Series = series)
|
||||
.With(e => e.SeriesId = 1)
|
||||
.With(e => e.SeasonNumber = 1)
|
||||
.With(e => e.Ignored = false)
|
||||
.Build();
|
||||
|
||||
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
|
||||
.WhereTheFirst(1)
|
||||
.TheFirst(1)
|
||||
.Has(p => p.CleanTitle = "title")
|
||||
.Has(p => p.SeasonNumber = 1)
|
||||
.Has(p => p.FullSeason = true)
|
||||
@ -95,11 +95,11 @@ public void SeasonSearch_season_failure()
|
||||
.Build();
|
||||
|
||||
var episodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll()
|
||||
.Have(e => e.Series = series)
|
||||
.Have(e => e.SeriesId = 1)
|
||||
.Have(e => e.SeasonNumber = 1)
|
||||
.Have(e => e.Ignored = false)
|
||||
.All()
|
||||
.With(e => e.Series = series)
|
||||
.With(e => e.SeriesId = 1)
|
||||
.With(e => e.SeasonNumber = 1)
|
||||
.With(e => e.Ignored = false)
|
||||
.Build();
|
||||
|
||||
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
|
||||
@ -150,7 +150,7 @@ public void ProcessSeasonSearchResults_success()
|
||||
.Build();
|
||||
|
||||
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
|
||||
.WhereTheFirst(1)
|
||||
.TheFirst(1)
|
||||
.Has(p => p.CleanTitle = "title")
|
||||
.Has(p => p.SeasonNumber = 1)
|
||||
.Has(p => p.FullSeason = true)
|
||||
@ -184,7 +184,7 @@ public void ProcessSeasonSearchResults_failure()
|
||||
.Build();
|
||||
|
||||
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
|
||||
.WhereTheFirst(1)
|
||||
.TheFirst(1)
|
||||
.Has(p => p.CleanTitle = "title")
|
||||
.Has(p => p.SeasonNumber = 1)
|
||||
.Has(p => p.FullSeason = true)
|
||||
|
@ -45,9 +45,9 @@ public void SeasonSearch_full_season_success()
|
||||
public void SeasonSearch_partial_season_success()
|
||||
{
|
||||
var episodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = 1)
|
||||
.Have(e => e.SeasonNumber = 1)
|
||||
.All()
|
||||
.With(e => e.SeriesId = 1)
|
||||
.With(e => e.SeasonNumber = 1)
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
@ -78,10 +78,10 @@ public void SeasonSearch_partial_season_success()
|
||||
public void SeasonSearch_partial_season_failure()
|
||||
{
|
||||
var episodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = 1)
|
||||
.Have(e => e.SeasonNumber = 1)
|
||||
.Have(e => e.Ignored = false)
|
||||
.All()
|
||||
.With(e => e.SeriesId = 1)
|
||||
.With(e => e.SeasonNumber = 1)
|
||||
.With(e => e.Ignored = false)
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
|
@ -33,7 +33,7 @@ public void Add_new_series(bool useSeasonFolder)
|
||||
var fakeProfiles = Builder<QualityProfile>.CreateListOfSize(2).Build();
|
||||
|
||||
db.InsertMany(fakeProfiles);
|
||||
|
||||
|
||||
const string path = "C:\\Test\\";
|
||||
const int tvDbId = 1234;
|
||||
const int qualityProfileId = 2;
|
||||
@ -216,13 +216,13 @@ public void Get_Series_With_Count()
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
|
||||
.WhereAll().Have(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.Have(e => e.Ignored = false)
|
||||
.Have(e => e.AirDate = DateTime.Today)
|
||||
.WhereTheFirst(5)
|
||||
.Have(e => e.EpisodeFileId = 0)
|
||||
.All().With(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.With(e => e.Ignored = false)
|
||||
.With(e => e.AirDate = DateTime.Today)
|
||||
.TheFirst(5)
|
||||
.With(e => e.EpisodeFileId = 0)
|
||||
.WhereTheLast(2)
|
||||
.Have(e => e.AirDate = DateTime.Today.AddDays(1))
|
||||
.With(e => e.AirDate = DateTime.Today.AddDays(1))
|
||||
.Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
@ -248,7 +248,7 @@ public void Get_Series_With_Count_AllIgnored()
|
||||
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10).WhereAll().Have(e => e.SeriesId = fakeSeries.SeriesId).Have(e => e.Ignored = true).WhereRandom(5).Have(e => e.EpisodeFileId = 0).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10).All().With(e => e.SeriesId = fakeSeries.SeriesId).With(e => e.Ignored = true).WhereRandom(5).With(e => e.EpisodeFileId = 0).Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
db.Insert(fakeQuality);
|
||||
@ -274,10 +274,10 @@ public void Get_Series_With_Count_AllDownloaded()
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.Have(e => e.Ignored = false)
|
||||
.Have(e => e.AirDate = DateTime.Today.AddDays(-1))
|
||||
.All()
|
||||
.With(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.With(e => e.Ignored = false)
|
||||
.With(e => e.AirDate = DateTime.Today.AddDays(-1))
|
||||
.Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
@ -304,13 +304,13 @@ public void Get_Series_With_Count_Half_Ignored()
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.Have(e => e.AirDate = DateTime.Today.AddDays(-1))
|
||||
.WhereTheFirst(5)
|
||||
.Have(e => e.Ignored = false)
|
||||
.All()
|
||||
.With(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.With(e => e.AirDate = DateTime.Today.AddDays(-1))
|
||||
.TheFirst(5)
|
||||
.With(e => e.Ignored = false)
|
||||
.WhereTheLast(5)
|
||||
.Have(e => e.Ignored = true)
|
||||
.With(e => e.Ignored = true)
|
||||
.Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
@ -362,10 +362,10 @@ public void SeriesPathExists_exact_match()
|
||||
var path = @"C:\Test\TV\30 Rock";
|
||||
|
||||
var fakeSeries = Builder<Series>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(c => c.QualityProfileId = 1)
|
||||
.WhereTheFirst(1)
|
||||
.Have(c => c.Path = path)
|
||||
.All()
|
||||
.With(c => c.QualityProfileId = 1)
|
||||
.TheFirst(1)
|
||||
.With(c => c.Path = path)
|
||||
.Build();
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
|
||||
@ -375,7 +375,7 @@ public void SeriesPathExists_exact_match()
|
||||
//Act
|
||||
mocker.Resolve<QualityProvider>();
|
||||
//mocker.GetMock<IDatabase>().Setup(s => s.Fetch<Series, QualityProfile>(It.IsAny<string>())).Returns(
|
||||
//fakeSeries.ToList());
|
||||
//fakeSeries.ToList());
|
||||
|
||||
var result = mocker.Resolve<SeriesProvider>().SeriesPathExists(path);
|
||||
|
||||
@ -393,10 +393,10 @@ public void SeriesPathExists_match()
|
||||
var path = @"C:\Test\TV\30 Rock";
|
||||
|
||||
var fakeSeries = Builder<Series>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(c => c.QualityProfileId = 1)
|
||||
.WhereTheFirst(1)
|
||||
.Have(c => c.Path = path)
|
||||
.All()
|
||||
.With(c => c.QualityProfileId = 1)
|
||||
.TheFirst(1)
|
||||
.With(c => c.Path = path)
|
||||
.Build();
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
|
||||
@ -424,10 +424,10 @@ public void SeriesPathExists_match_alt()
|
||||
var path = @"C:\Test\TV\The Simpsons";
|
||||
|
||||
var fakeSeries = Builder<Series>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(c => c.QualityProfileId = 1)
|
||||
.WhereTheFirst(1)
|
||||
.Have(c => c.Path = path)
|
||||
.All()
|
||||
.With(c => c.QualityProfileId = 1)
|
||||
.TheFirst(1)
|
||||
.With(c => c.Path = path)
|
||||
.Build();
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
|
||||
@ -455,10 +455,10 @@ public void SeriesPathExists_match_false()
|
||||
var path = @"C:\Test\TV\30 Rock";
|
||||
|
||||
var fakeSeries = Builder<Series>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(c => c.QualityProfileId = 1)
|
||||
.WhereTheFirst(1)
|
||||
.Have(c => c.Path = path)
|
||||
.All()
|
||||
.With(c => c.QualityProfileId = 1)
|
||||
.TheFirst(1)
|
||||
.With(c => c.Path = path)
|
||||
.Build();
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
|
||||
@ -486,13 +486,12 @@ public void Get_Series_NextAiring_Today()
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.Have(e => e.Ignored = false)
|
||||
.WhereTheFirst(1)
|
||||
.Have(e => e.AirDate = DateTime.Today)
|
||||
.AndTheRemaining()
|
||||
.Have(e => e.AirDate = DateTime.Today.AddDays(1))
|
||||
.All()
|
||||
.With(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.With(e => e.Ignored = false)
|
||||
.With(e => e.AirDate = DateTime.Today.AddDays(1))
|
||||
.TheFirst(1)
|
||||
.With(e => e.AirDate = DateTime.Today)
|
||||
.Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
@ -518,13 +517,12 @@ public void Get_Series_NextAiring_Tomorrow_Last_Aired_Yesterday()
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.Have(e => e.Ignored = false)
|
||||
.WhereTheFirst(1)
|
||||
.Have(e => e.AirDate = DateTime.Today.AddDays(-1))
|
||||
.AndTheRemaining()
|
||||
.Have(e => e.AirDate = DateTime.Today.AddDays(1))
|
||||
.All()
|
||||
.With(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.With(e => e.Ignored = false)
|
||||
.With(e => e.AirDate = DateTime.Today.AddDays(1))
|
||||
.TheFirst(1)
|
||||
.With(e => e.AirDate = DateTime.Today.AddDays(-1))
|
||||
.Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
@ -550,10 +548,10 @@ public void Get_Series_NextAiring_Unknown()
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.Have(e => e.AirDate = null)
|
||||
.Have(e => e.Ignored = false)
|
||||
.All()
|
||||
.With(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.With(e => e.AirDate = null)
|
||||
.With(e => e.Ignored = false)
|
||||
.Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
@ -579,13 +577,12 @@ public void Get_Series_NextAiring_1_month()
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.Have(e => e.Ignored = false)
|
||||
.WhereTheFirst(1)
|
||||
.Have(e => e.AirDate = DateTime.Today.AddDays(-1))
|
||||
.AndTheRemaining()
|
||||
.Have(e => e.AirDate = DateTime.Today.AddMonths(1))
|
||||
.All()
|
||||
.With(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.With(e => e.Ignored = false)
|
||||
.With(e => e.AirDate = DateTime.Today.AddMonths(1))
|
||||
.TheFirst(1)
|
||||
.With(e => e.AirDate = DateTime.Today.AddDays(-1))
|
||||
.Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
@ -611,14 +608,13 @@ public void Get_Series_NextAiring_skip_ignored()
|
||||
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
|
||||
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.WhereTheFirst(1)
|
||||
.Have(e => e.AirDate = DateTime.Today.AddDays(1))
|
||||
.Have(e => e.Ignored = true)
|
||||
.AndTheRemaining()
|
||||
.Have(e => e.AirDate = DateTime.Today.AddMonths(1))
|
||||
.Have(e => e.Ignored = false)
|
||||
.All()
|
||||
.With(e => e.SeriesId = fakeSeries.SeriesId)
|
||||
.With(e => e.AirDate = DateTime.Today.AddMonths(1))
|
||||
.With(e => e.Ignored = false)
|
||||
.TheFirst(1)
|
||||
.With(e => e.AirDate = DateTime.Today.AddDays(1))
|
||||
.With(e => e.Ignored = true)
|
||||
.Build();
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
|
@ -23,10 +23,10 @@ public class UpcomingEpisodesProviderTest : TestBase
|
||||
public new void Setup()
|
||||
{
|
||||
episodes = Builder<Episode>.CreateListOfSize(6)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = 1)
|
||||
.Have(e => e.Ignored = false)
|
||||
.WhereTheFirst(1)
|
||||
.All()
|
||||
.With(e => e.SeriesId = 1)
|
||||
.With(e => e.Ignored = false)
|
||||
.TheFirst(1)
|
||||
.Has(e => e.AirDate = DateTime.Today.AddDays(-1))
|
||||
.AndTheNext(1)
|
||||
.Has(e => e.AirDate = DateTime.Today)
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NBuilder" version="2.3.0.0" />
|
||||
<package id="AutoMoq" version="1.3.1.3" />
|
||||
<package id="Moq" version="4.0.10827" />
|
||||
<package id="CommonServiceLocator" version="1.0" />
|
||||
<package id="Unity" version="2.1.505.0" />
|
||||
<package id="Moq" version="4.0.10827" />
|
||||
<package id="NBuilder" version="3.0.1" />
|
||||
<package id="Ninject" version="2.2.1.4" />
|
||||
<package id="NUnit" version="2.5.10.11092" />
|
||||
<package id="SqlServerCompact" version="4.0.8482.1" />
|
||||
<package id="Ninject" version="2.2.1.4" />
|
||||
<package id="Unity" version="2.1.505.0" />
|
||||
</packages>
|
BIN
packages/NBuilder.2.3.0.0/NBuilder.2.3.0.0.nupkg
vendored
BIN
packages/NBuilder.2.3.0.0/NBuilder.2.3.0.0.nupkg
vendored
Binary file not shown.
BIN
packages/NBuilder.2.3.0.0/lib/FizzWare.NBuilder.dll
vendored
BIN
packages/NBuilder.2.3.0.0/lib/FizzWare.NBuilder.dll
vendored
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user