Upgraded to NBuilder 3.

pull/6/head
Keivan Beigi 13 years ago
parent e87cdbde44
commit 88b8c053fc

@ -102,9 +102,9 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
//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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
{
//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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
.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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
//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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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>
Loading…
Cancel
Save