Upgraded to NBuilder 3.

pull/4/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 notification = new ProgressNotification("Backlog Search Job Test");
var episodes = Builder<Episode>.CreateListOfSize(5) var episodes = Builder<Episode>.CreateListOfSize(5)
.WhereAll() .All()
.Have(e => e.SeriesId = 1) .With(e => e.SeriesId = 1)
.Have(e => e.SeasonNumber = 1) .With(e => e.SeasonNumber = 1)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -136,9 +136,9 @@ namespace NzbDrone.Core.Test
var notification = new ProgressNotification("Backlog Search Job Test"); var notification = new ProgressNotification("Backlog Search Job Test");
var episodes = Builder<Episode>.CreateListOfSize(5) var episodes = Builder<Episode>.CreateListOfSize(5)
.WhereAll() .All()
.Have(e => e.SeriesId = 1) .With(e => e.SeriesId = 1)
.Have(e => e.SeasonNumber = 1) .With(e => e.SeasonNumber = 1)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -170,9 +170,9 @@ namespace NzbDrone.Core.Test
var notification = new ProgressNotification("Backlog Search Job Test"); var notification = new ProgressNotification("Backlog Search Job Test");
var episodes = Builder<Episode>.CreateListOfSize(10) var episodes = Builder<Episode>.CreateListOfSize(10)
.WhereTheFirst(5) .TheFirst(5)
.Have(e => e.SeriesId = 1) .With(e => e.SeriesId = 1)
.Have(e => e.SeasonNumber = 1) .With(e => e.SeasonNumber = 1)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);

@ -60,7 +60,7 @@ namespace NzbDrone.Core.Test
//Setup //Setup
var fakeSeries = Builder<Series>.CreateListOfSize(10) var fakeSeries = Builder<Series>.CreateListOfSize(10)
.WhereRandom(2) .WhereRandom(2)
.Have(s => s.BannerUrl = null) .With(s => s.BannerUrl = null)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);

@ -48,7 +48,7 @@ namespace NzbDrone.Core.Test
public void job_with_no_target_should_scan_all_series() public void job_with_no_target_should_scan_all_series()
{ {
var series = Builder<Series>.CreateListOfSize(2) 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) .AndTheNext(1).Has(s => s.SeriesId = 15)
.Build(); .Build();
@ -76,7 +76,7 @@ namespace NzbDrone.Core.Test
public void failed_scan_should_not_terminated_job() public void failed_scan_should_not_terminated_job()
{ {
var series = Builder<Series>.CreateListOfSize(2) 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) .AndTheNext(1).Has(s => s.SeriesId = 15)
.Build(); .Build();
@ -105,7 +105,7 @@ namespace NzbDrone.Core.Test
public void job_with_no_target_should_scan_series_with_episodes() public void job_with_no_target_should_scan_series_with_episodes()
{ {
var series = Builder<Series>.CreateListOfSize(2) 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) .AndTheNext(1).Has(s => s.SeriesId = 15)
.Build(); .Build();

@ -254,8 +254,8 @@ namespace NzbDrone.Core.Test
var fakeSeries = Builder<Series>.CreateNew().Build(); var fakeSeries = Builder<Series>.CreateNew().Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2) var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(e => e.EpisodeFile = Builder<EpisodeFile>.CreateNew() .With(e => e.EpisodeFile = Builder<EpisodeFile>.CreateNew()
.With(f => f.Quality = QualityTypes.SDTV) .With(f => f.Quality = QualityTypes.SDTV)
.Build()) .Build())
.Build(); .Build();
@ -289,8 +289,8 @@ namespace NzbDrone.Core.Test
var fakeSeries = Builder<Series>.CreateNew().Build(); var fakeSeries = Builder<Series>.CreateNew().Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2) var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(e => e.EpisodeFile = Builder<EpisodeFile>.CreateNew() .With(e => e.EpisodeFile = Builder<EpisodeFile>.CreateNew()
.With(f => f.Quality = QualityTypes.Bluray720p) .With(f => f.Quality = QualityTypes.Bluray720p)
.Build()) .Build())
.Build(); .Build();
@ -324,8 +324,8 @@ namespace NzbDrone.Core.Test
var fakeSeries = Builder<Series>.CreateNew().Build(); var fakeSeries = Builder<Series>.CreateNew().Build();
var fakeEpisodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var fakeEpisodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.WhereAll() .All()
.Have(e => e.Quality = QualityTypes.SDTV) .With(e => e.Quality = QualityTypes.SDTV)
.Build(); .Build();
var fakeEpisode1 = Builder<Episode>.CreateNew() var fakeEpisode1 = Builder<Episode>.CreateNew()

@ -25,9 +25,9 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(2) 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) .AndTheNext(1).Has(s => s.EpisodeId = 99)
.WhereAll().Has(s => s.SeriesId = 5) .All().Has(s => s.SeriesId = 5)
.Build(); .Build();

@ -32,7 +32,7 @@ namespace NzbDrone.Core.Test
var fakeSeries = Builder<Series>.CreateNew().Build(); var fakeSeries = Builder<Series>.CreateNew().Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5) 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.Insert(fakeSeries);
db.InsertMany(fakeEpisodes); db.InsertMany(fakeEpisodes);
@ -98,7 +98,7 @@ namespace NzbDrone.Core.Test
var fakeSeries = Builder<Series>.CreateNew().Build(); var fakeSeries = Builder<Series>.CreateNew().Build();
var fakeFile = Builder<EpisodeFile>.CreateNew().With(f => f.EpisodeFileId).Build(); var fakeFile = Builder<EpisodeFile>.CreateNew().With(f => f.EpisodeFileId).Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5) 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.Insert(fakeSeries);
db.InsertMany(fakeEpisodes); db.InsertMany(fakeEpisodes);
@ -124,7 +124,7 @@ namespace NzbDrone.Core.Test
mocker.Resolve<SeriesProvider>(); mocker.Resolve<SeriesProvider>();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5) var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
.WhereAll().Have(e => e.SeriesId = 1).Build(); .All().With(e => e.SeriesId = 1).Build();
db.InsertMany(fakeEpisodes); db.InsertMany(fakeEpisodes);
@ -154,7 +154,7 @@ namespace NzbDrone.Core.Test
var fakeSeries = Builder<Series>.CreateNew().With(s => s.SeriesId = 12).Build(); var fakeSeries = Builder<Series>.CreateNew().With(s => s.SeriesId = 12).Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5) var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
.WhereAll().Have(e => e.SeriesId = 12).Build(); .All().With(e => e.SeriesId = 12).Build();
mocker.GetMock<SeriesProvider>() mocker.GetMock<SeriesProvider>()
.Setup(c => c.GetSeries(12)) .Setup(c => c.GetSeries(12))
@ -225,9 +225,9 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(10) var episodes = Builder<Episode>.CreateListOfSize(10)
.WhereAll().Have(c => c.SeriesId = 12) .All().With(c => c.SeriesId = 12).And(c => c.SeasonNumber = 2)
.WhereTheFirst(5).Have(c => c.SeasonNumber = 1) .TheFirst(5).With(c => c.SeasonNumber = 1)
.AndTheRemaining().Have(c => c.SeasonNumber = 2).Build(); .Build();
var db = MockLib.GetEmptyDatabase(); var db = MockLib.GetEmptyDatabase();
var mocker = new AutoMoqer(); var mocker = new AutoMoqer();
@ -254,8 +254,8 @@ namespace NzbDrone.Core.Test
var fakeEpisodes = Builder<TvdbSeries>.CreateNew().With( var fakeEpisodes = Builder<TvdbSeries>.CreateNew().With(
c => c.Episodes = c => c.Episodes =
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount). new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
WhereAll() All()
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a")) .With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
.Build()) .Build())
).With(c => c.Id = seriesId).Build(); ).With(c => c.Id = seriesId).Build();
@ -293,10 +293,9 @@ namespace NzbDrone.Core.Test
var fakeEpisodes = Builder<TvdbSeries>.CreateNew().With( var fakeEpisodes = Builder<TvdbSeries>.CreateNew().With(
c => c.Episodes = c => c.Episodes =
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(10). new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(10).
WhereAll() All()
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a")) .With(l => l.Language = new TvdbLanguage(0, "eng", "a")).And(e => e.FirstAired = DateTime.Now)
.WhereTheFirst(7).Have(e => e.FirstAired = new DateTime(1800, 1, 1)) .TheFirst(7).With(e => e.FirstAired = new DateTime(1800, 1, 1))
.AndTheRemaining().Have(e => e.FirstAired = DateTime.Now)
.Build()) .Build())
).With(c => c.Id = seriesId).Build(); ).With(c => c.Id = seriesId).Build();
@ -336,9 +335,9 @@ namespace NzbDrone.Core.Test
var fakeEpisodes = Builder<TvdbSeries>.CreateNew().With( var fakeEpisodes = Builder<TvdbSeries>.CreateNew().With(
c => c.Episodes = c => c.Episodes =
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount). new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
WhereAll() All()
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a")) .With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
.WhereTheFirst(1) .TheFirst(1)
.Has(e => e.EpisodeNumber = 0) .Has(e => e.EpisodeNumber = 0)
.Has(e => e.SeasonNumber = 15) .Has(e => e.SeasonNumber = 15)
.Build()) .Build())
@ -447,7 +446,7 @@ namespace NzbDrone.Core.Test
.With(c => c.Id = seriesId) .With(c => c.Id = seriesId)
.With(c => c.Episodes = new List<TvdbEpisode>( .With(c => c.Episodes = new List<TvdbEpisode>(
Builder<TvdbEpisode>.CreateListOfSize(1) Builder<TvdbEpisode>.CreateListOfSize(1)
.WhereAll().Have(g => g.Id = 99) .All().With(g => g.Id = 99)
.Build()) .Build())
) )
.Build(); .Build();
@ -565,10 +564,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.Ignored = true) .With(c => c.Ignored = true)
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 2) .With(c => c.SeasonNumber = 2)
.Build(); .Build();
episodes.ToList().ForEach(c => db.Insert(c)); episodes.ToList().ForEach(c => db.Insert(c));
@ -588,10 +587,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.Ignored = false) .With(c => c.Ignored = false)
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 2) .With(c => c.SeasonNumber = 2)
.Build(); .Build();
episodes.ToList().ForEach(c => db.Insert(c)); episodes.ToList().ForEach(c => db.Insert(c));
@ -611,10 +610,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 2) .With(c => c.SeasonNumber = 2)
.Have(c => c.Ignored = true) .With(c => c.Ignored = true)
.Build(); .Build();
episodes[2].Ignored = false; episodes[2].Ignored = false;
@ -637,10 +636,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 3) .With(c => c.SeasonNumber = 3)
.Have(c => c.Ignored = true) .With(c => c.Ignored = true)
.Build(); .Build();
episodes.ToList().ForEach(c => db.Insert(c)); episodes.ToList().ForEach(c => db.Insert(c));
@ -660,10 +659,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 3) .With(c => c.SeasonNumber = 3)
.Have(c => c.Ignored = true) .With(c => c.Ignored = true)
.Build(); .Build();
episodes.ToList().ForEach(c => db.Insert(c)); episodes.ToList().ForEach(c => db.Insert(c));
@ -683,10 +682,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 3) .With(c => c.SeasonNumber = 3)
.Have(c => c.Ignored = false) .With(c => c.Ignored = false)
.Build(); .Build();
episodes.ToList().ForEach(c => db.Insert(c)); episodes.ToList().ForEach(c => db.Insert(c));
@ -734,10 +733,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 0) .With(c => c.SeasonNumber = 0)
.Have(c => c.Ignored = false) .With(c => c.Ignored = false)
.Build(); .Build();
episodes.ToList().ForEach(c => db.Insert(c)); episodes.ToList().ForEach(c => db.Insert(c));
@ -803,7 +802,7 @@ namespace NzbDrone.Core.Test
var fakeSeries = Builder<Series>.CreateNew().Build(); var fakeSeries = Builder<Series>.CreateNew().Build();
var fakeFile = Builder<EpisodeFile>.CreateNew().With(f => f.EpisodeFileId).Build(); var fakeFile = Builder<EpisodeFile>.CreateNew().With(f => f.EpisodeFileId).Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5) 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.Insert(fakeSeries);
db.InsertMany(fakeEpisodes); db.InsertMany(fakeEpisodes);
@ -827,7 +826,7 @@ namespace NzbDrone.Core.Test
var fakeSeries = Builder<Series>.CreateNew().Build(); var fakeSeries = Builder<Series>.CreateNew().Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5) 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.Insert(fakeSeries);
db.InsertMany(fakeEpisodes); db.InsertMany(fakeEpisodes);
@ -851,7 +850,7 @@ namespace NzbDrone.Core.Test
var fakeSeries = Builder<Series>.CreateNew().Build(); var fakeSeries = Builder<Series>.CreateNew().Build();
var fakeFile = Builder<EpisodeFile>.CreateNew().With(f => f.EpisodeFileId).Build(); var fakeFile = Builder<EpisodeFile>.CreateNew().With(f => f.EpisodeFileId).Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5) 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.Insert(fakeSeries);
db.InsertMany(fakeEpisodes); db.InsertMany(fakeEpisodes);
@ -875,7 +874,7 @@ namespace NzbDrone.Core.Test
var fakeSeries = Builder<Series>.CreateNew().Build(); var fakeSeries = Builder<Series>.CreateNew().Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5) 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.InsertMany(fakeEpisodes);
db.Insert(fakeSeries); db.Insert(fakeSeries);
@ -897,7 +896,7 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5) var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
.WhereAll().Have(e => e.GrabDate = null) .All().With(e => e.GrabDate = null)
.Build(); .Build();
db.InsertMany(fakeEpisodes); db.InsertMany(fakeEpisodes);
@ -921,10 +920,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.Ignored = true) .With(c => c.Ignored = true)
.Build().ToList(); .Build().ToList();
episodes.ForEach(c => db.Insert(c)); episodes.ForEach(c => db.Insert(c));
@ -957,10 +956,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.Ignored = false) .With(c => c.Ignored = false)
.Build().ToList(); .Build().ToList();
episodes.ForEach(c => db.Insert(c)); episodes.ForEach(c => db.Insert(c));
@ -993,13 +992,12 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .And(c => c.SeasonNumber = 1)
.WhereTheFirst(2) .And(c => c.Ignored = true)
.Have(c => c.Ignored = false) .TheFirst(2)
.AndTheRemaining() .With(c => c.Ignored = false)
.Have(c => c.Ignored = true)
.Build().ToList(); .Build().ToList();
episodes.ForEach(c => db.Insert(c)); episodes.ForEach(c => db.Insert(c));
@ -1032,10 +1030,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.Ignored = false) .With(c => c.Ignored = false)
.Build().ToList(); .Build().ToList();
episodes.ForEach(c => db.Insert(c)); episodes.ForEach(c => db.Insert(c));
@ -1060,10 +1058,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.Ignored = true) .With(c => c.Ignored = true)
.Build().ToList(); .Build().ToList();
episodes.ForEach(c => db.Insert(c)); episodes.ForEach(c => db.Insert(c));
@ -1088,10 +1086,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.Ignored = false) .With(c => c.Ignored = false)
.Build().ToList(); .Build().ToList();
episodes.ForEach(c => db.Insert(c)); episodes.ForEach(c => db.Insert(c));
@ -1116,10 +1114,10 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.Ignored = true) .With(c => c.Ignored = true)
.Build().ToList(); .Build().ToList();
episodes.ForEach(c => db.Insert(c)); episodes.ForEach(c => db.Insert(c));
@ -1144,13 +1142,12 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.WhereTheFirst(2) .With(c => c.Ignored = true)
.Have(c => c.Ignored = false) .TheFirst(2)
.AndTheRemaining() .With(c => c.Ignored = false)
.Have(c => c.Ignored = true)
.Build().ToList(); .Build().ToList();
episodes.ForEach(c => db.Insert(c)); episodes.ForEach(c => db.Insert(c));
@ -1179,27 +1176,25 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.AirDate = DateTime.Today.AddDays(-4)) .With(c => c.AirDate = DateTime.Today.AddDays(-4))
.Have(c => c.Ignored = true) .With(c => c.Ignored = true)
.WhereTheFirst(2) .TheFirst(2)
.Have(c => c.EpisodeFileId = 0) .With(c => c.EpisodeFileId = 0)
.WhereSection(1, 2) .WhereSection(1, 2)
.Have(c => c.Ignored = false) .With(c => c.Ignored = false)
.Build().ToList(); .Build().ToList();
var specials = Builder<Episode>.CreateListOfSize(2) var specials = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 0) .With(c => c.SeasonNumber = 0)
.Have(c => c.AirDate = DateTime.Today.AddDays(-4)) .With(c => c.AirDate = DateTime.Today.AddDays(-4))
.Have(c => c.EpisodeFileId = 0) .With(c => c.EpisodeFileId = 0)
.WhereTheFirst(1) .With(c => c.Ignored = false)
.Have(c => c.Ignored = true) .TheFirst(1).With(c => c.Ignored = true)
.AndTheRemaining()
.Have(c => c.Ignored = false)
.Build().ToList(); .Build().ToList();
db.Insert(series); db.Insert(series);
@ -1228,27 +1223,26 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(4) var episodes = Builder<Episode>.CreateListOfSize(4)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.AirDate = DateTime.Today.AddDays(-4)) .With(c => c.AirDate = DateTime.Today.AddDays(-4))
.Have(c => c.Ignored = true) .With(c => c.Ignored = true)
.WhereTheFirst(2) .TheFirst(2)
.Have(c => c.EpisodeFileId = 0) .With(c => c.EpisodeFileId = 0)
.WhereSection(1, 2) .WhereSection(1, 2)
.Have(c => c.Ignored = false) .With(c => c.Ignored = false)
.Build().ToList(); .Build().ToList();
var specials = Builder<Episode>.CreateListOfSize(2) var specials = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 0) .With(c => c.SeasonNumber = 0)
.Have(c => c.AirDate = DateTime.Today.AddDays(-4)) .With(c => c.AirDate = DateTime.Today.AddDays(-4))
.Have(c => c.EpisodeFileId = 0) .With(c => c.EpisodeFileId = 0)
.WhereTheFirst(1) .With(c => c.Ignored = false)
.Have(c => c.Ignored = true) .TheFirst(1)
.AndTheRemaining() .With(c => c.Ignored = true)
.Have(c => c.Ignored = false)
.Build().ToList(); .Build().ToList();
db.Insert(series); db.Insert(series);
@ -1281,13 +1275,13 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(2) var episodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.AirDate = DateTime.Today.AddDays(-4)) .With(c => c.AirDate = DateTime.Today.AddDays(-4))
.Have(c => c.Ignored = true) .With(c => c.Ignored = true)
.Have(c => c.EpisodeFile = episodeFile) .With(c => c.EpisodeFile = episodeFile)
.Have(c => c.EpisodeFileId = episodeFile.EpisodeFileId) .With(c => c.EpisodeFileId = episodeFile.EpisodeFileId)
.Build().ToList(); .Build().ToList();
db.Insert(series); db.Insert(series);
@ -1323,12 +1317,12 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(2) var episodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.AirDate = DateTime.Today.AddDays(-4)) .With(c => c.AirDate = DateTime.Today.AddDays(-4))
.Have(c => c.Ignored = true) .With(c => c.Ignored = true)
.Have(c => c.EpisodeFileId = 0) .With(c => c.EpisodeFileId = 0)
.Build().ToList(); .Build().ToList();
db.Insert(series); db.Insert(series);
@ -1355,10 +1349,10 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2) var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.EpisodeFileId = 12345) .With(c => c.EpisodeFileId = 12345)
.Build(); .Build();
db.Insert(series); db.Insert(series);
@ -1409,9 +1403,9 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10) var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Build(); .Build();
db.InsertMany(fakeEpisodes); db.InsertMany(fakeEpisodes);
@ -1431,9 +1425,9 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10) var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Build(); .Build();
db.InsertMany(fakeEpisodes); db.InsertMany(fakeEpisodes);
@ -1453,9 +1447,9 @@ namespace NzbDrone.Core.Test
mocker.SetConstant(db); mocker.SetConstant(db);
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10) var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
.WhereAll() .All()
.Have(c => c.SeriesId = 10) .With(c => c.SeriesId = 10)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Build(); .Build();
db.InsertMany(fakeEpisodes); db.InsertMany(fakeEpisodes);
@ -1485,10 +1479,10 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(episodeCount) var fakeEpisodes = Builder<Episode>.CreateListOfSize(episodeCount)
.WhereAll() .All()
.Have(c => c.SeriesId = 12345) .With(c => c.SeriesId = 12345)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown) .With(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
.Build(); .Build();
db.Insert(fakeSeries); db.Insert(fakeSeries);
@ -1519,10 +1513,10 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(1) var fakeEpisodes = Builder<Episode>.CreateListOfSize(1)
.WhereAll() .All()
.Have(c => c.SeriesId = 12345) .With(c => c.SeriesId = 12345)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown) .With(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
.Build(); .Build();
db.Insert(fakeSeries); db.Insert(fakeSeries);
@ -1531,7 +1525,7 @@ namespace NzbDrone.Core.Test
mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("officeus")).Returns(fakeSeries); mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("officeus")).Returns(fakeSeries);
//Act //Act
mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>{300}, postDownloadStatus); mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int> { 300 }, postDownloadStatus);
//Assert //Assert
var result = db.Fetch<Episode>(); var result = db.Fetch<Episode>();

@ -31,8 +31,8 @@ namespace NzbDrone.Core.Test
var tvDbSeries = Builder<TvdbSeries>.CreateNew().With( var tvDbSeries = Builder<TvdbSeries>.CreateNew().With(
c => c.Episodes = c => c.Episodes =
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount). new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
WhereAll() All()
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a")) .With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
.Build()) .Build())
).With(c => c.Id = seriesId).Build(); ).With(c => c.Id = seriesId).Build();
@ -71,8 +71,8 @@ namespace NzbDrone.Core.Test
var tvDbSeries = Builder<TvdbSeries>.CreateNew().With( var tvDbSeries = Builder<TvdbSeries>.CreateNew().With(
c => c.Episodes = c => c.Episodes =
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount). new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
WhereAll() All()
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a")) .With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
.Build()) .Build())
).With(c => c.Id = seriesId).Build(); ).With(c => c.Id = seriesId).Build();
@ -111,8 +111,8 @@ namespace NzbDrone.Core.Test
var tvDbSeries = Builder<TvdbSeries>.CreateNew().With( var tvDbSeries = Builder<TvdbSeries>.CreateNew().With(
c => c.Episodes = c => c.Episodes =
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount). new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
WhereAll() All()
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a")) .With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
.Build()) .Build())
).With(c => c.Id = seriesId).Build(); ).With(c => c.Id = seriesId).Build();
@ -151,8 +151,8 @@ namespace NzbDrone.Core.Test
var tvDbSeries = Builder<TvdbSeries>.CreateNew().With( var tvDbSeries = Builder<TvdbSeries>.CreateNew().With(
c => c.Episodes = c => c.Episodes =
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount). new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
WhereAll() All()
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a")) .With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
.Build()) .Build())
).With(c => c.Id = seriesId).Build(); ).With(c => c.Id = seriesId).Build();
@ -194,8 +194,8 @@ namespace NzbDrone.Core.Test
var tvDbSeries = Builder<TvdbSeries>.CreateNew().With( var tvDbSeries = Builder<TvdbSeries>.CreateNew().With(
c => c.Episodes = c => c.Episodes =
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount). new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
WhereAll() All()
.Have(l => l.Language = new TvdbLanguage(0, "eng", "a")) .With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
.Build()) .Build())
).With(c => c.Id = seriesId).Build(); ).With(c => c.Id = seriesId).Build();

@ -45,7 +45,7 @@ namespace NzbDrone.Core.Test
var episodes = Builder<Episode>.CreateListOfSize(10).Build(); 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 mocker = new AutoMoqer();
var db = MockLib.GetEmptyDatabase(); var db = MockLib.GetEmptyDatabase();
@ -95,8 +95,8 @@ namespace NzbDrone.Core.Test
{ {
//Setup //Setup
var historyItem = Builder<History>.CreateListOfSize(20) var historyItem = Builder<History>.CreateListOfSize(20)
.WhereTheFirst(10).Have(c => c.Date = DateTime.Now) .TheFirst(10).With(c => c.Date = DateTime.Now)
.AndTheNext(10).Have(c => c.Date = DateTime.Now.AddDays(-31)) .AndTheNext(10).With(c => c.Date = DateTime.Now.AddDays(-31))
.Build(); .Build();
var mocker = new AutoMoqer(); var mocker = new AutoMoqer();

@ -21,8 +21,8 @@ namespace NzbDrone.Core.Test
public void import_new_series_succesfull() public void import_new_series_succesfull()
{ {
var series = Builder<Series>.CreateListOfSize(2) var series = Builder<Series>.CreateListOfSize(2)
.WhereAll().Have(s => s.LastInfoSync = null) .All().With(s => s.LastInfoSync = null)
.WhereTheFirst(1).Has(s => s.SeriesId = 12) .TheFirst(1).Has(s => s.SeriesId = 12)
.AndTheNext(1).Has(s => s.SeriesId = 15) .AndTheNext(1).Has(s => s.SeriesId = 15)
.Build(); .Build();
@ -86,8 +86,8 @@ namespace NzbDrone.Core.Test
public void failed_import_should_not_be_stuck_in_loop() public void failed_import_should_not_be_stuck_in_loop()
{ {
var series = Builder<Series>.CreateListOfSize(2) var series = Builder<Series>.CreateListOfSize(2)
.WhereAll().Have(s => s.LastInfoSync = null) .All().With(s => s.LastInfoSync = null)
.WhereTheFirst(1).Has(s => s.SeriesId = 12) .TheFirst(1).Has(s => s.SeriesId = 12)
.AndTheNext(1).Has(s => s.SeriesId = 15) .AndTheNext(1).Has(s => s.SeriesId = 15)
.Build(); .Build();
@ -163,7 +163,7 @@ namespace NzbDrone.Core.Test
int seriesId = 12; int seriesId = 12;
var episodesFiles = Builder<EpisodeFile>.CreateListOfSize(2) var episodesFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.WhereAll().Have(e => e.SeriesId = seriesId) .All().With(e => e.SeriesId = seriesId)
.Build(); .Build();
episodesFiles[0].SeasonNumber = 0; episodesFiles[0].SeasonNumber = 0;
@ -190,7 +190,7 @@ namespace NzbDrone.Core.Test
int seriesId = 12; int seriesId = 12;
var episodesFiles = Builder<EpisodeFile>.CreateListOfSize(2) var episodesFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.WhereAll().Have(e => e.SeriesId = seriesId) .All().With(e => e.SeriesId = seriesId)
.Build(); .Build();
episodesFiles[0].SeasonNumber = 1; episodesFiles[0].SeasonNumber = 1;

@ -28,10 +28,10 @@ namespace NzbDrone.Core.Test
public void get_series_files() public void get_series_files()
{ {
var firstSeriesFiles = Builder<EpisodeFile>.CreateListOfSize(10) 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) var secondSeriesFiles = Builder<EpisodeFile>.CreateListOfSize(10)
.WhereAll().Have(s => s.SeriesId = 20).Build(); .All().With(s => s.SeriesId = 20).Build();
var mocker = new AutoMoqer(); var mocker = new AutoMoqer();
@ -53,15 +53,15 @@ namespace NzbDrone.Core.Test
public void get_season_files() public void get_season_files()
{ {
var firstSeriesFiles = Builder<EpisodeFile>.CreateListOfSize(10) var firstSeriesFiles = Builder<EpisodeFile>.CreateListOfSize(10)
.WhereAll() .All()
.Have(s => s.SeriesId = 12) .With(s => s.SeriesId = 12)
.Have(s => s.SeasonNumber = 1) .With(s => s.SeasonNumber = 1)
.Build(); .Build();
var secondSeriesFiles = Builder<EpisodeFile>.CreateListOfSize(10) var secondSeriesFiles = Builder<EpisodeFile>.CreateListOfSize(10)
.WhereAll() .All()
.Have(s => s.SeriesId = 12) .With(s => s.SeriesId = 12)
.Have(s => s.SeasonNumber = 2) .With(s => s.SeasonNumber = 2)
.Build(); .Build();
var mocker = new AutoMoqer(); var mocker = new AutoMoqer();

@ -27,7 +27,7 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.WhereTheFirst(1) .TheFirst(1)
.Has(f => f.EpisodeFileId = 1) .Has(f => f.EpisodeFileId = 1)
.Has(f => f.Path = @"C:\Test\Title1.avi") .Has(f => f.Path = @"C:\Test\Title1.avi")
.AndTheNext(1) .AndTheNext(1)
@ -36,9 +36,9 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(2) var episodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(e => e.Series = series) .With(e => e.Series = series)
.WhereTheFirst(1) .TheFirst(1)
.Has(e => e.EpisodeFileId = 1) .Has(e => e.EpisodeFileId = 1)
.Has(e => e.EpisodeFile = episodeFiles[0]) .Has(e => e.EpisodeFile = episodeFiles[0])
.AndTheNext(1) .AndTheNext(1)
@ -76,7 +76,7 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.WhereTheFirst(1) .TheFirst(1)
.Has(f => f.EpisodeFileId = 1) .Has(f => f.EpisodeFileId = 1)
.Has(f => f.Path = @"C:\Test\Title1.avi") .Has(f => f.Path = @"C:\Test\Title1.avi")
.AndTheNext(1) .AndTheNext(1)
@ -85,9 +85,9 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(2) var episodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(e => e.Series = series) .With(e => e.Series = series)
.WhereTheFirst(1) .TheFirst(1)
.Has(e => e.EpisodeFileId = 1) .Has(e => e.EpisodeFileId = 1)
.Has(e => e.EpisodeFile = episodeFiles[0]) .Has(e => e.EpisodeFile = episodeFiles[0])
.AndTheNext(1) .AndTheNext(1)
@ -125,7 +125,7 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.WhereTheFirst(1) .TheFirst(1)
.Has(f => f.EpisodeFileId = 1) .Has(f => f.EpisodeFileId = 1)
.Has(f => f.Path = @"C:\Test\Title1.avi") .Has(f => f.Path = @"C:\Test\Title1.avi")
.AndTheNext(1) .AndTheNext(1)
@ -134,9 +134,9 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(2) var episodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(e => e.Series = series) .With(e => e.Series = series)
.WhereTheFirst(1) .TheFirst(1)
.Has(e => e.EpisodeFileId = 1) .Has(e => e.EpisodeFileId = 1)
.Has(e => e.EpisodeFile = episodeFiles[0]) .Has(e => e.EpisodeFile = episodeFiles[0])
.AndTheNext(1) .AndTheNext(1)
@ -176,7 +176,7 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.WhereTheFirst(1) .TheFirst(1)
.Has(f => f.EpisodeFileId = 1) .Has(f => f.EpisodeFileId = 1)
.Has(f => f.Path = @"C:\Test\Title1.avi") .Has(f => f.Path = @"C:\Test\Title1.avi")
.AndTheNext(1) .AndTheNext(1)
@ -185,9 +185,9 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(3) var episodes = Builder<Episode>.CreateListOfSize(3)
.WhereAll() .All()
.Have(e => e.Series = series) .With(e => e.Series = series)
.WhereTheFirst(2) .TheFirst(2)
.Has(e => e.EpisodeFileId = 1) .Has(e => e.EpisodeFileId = 1)
.Has(e => e.EpisodeFile = episodeFiles[0]) .Has(e => e.EpisodeFile = episodeFiles[0])
.AndTheNext(1) .AndTheNext(1)
@ -227,7 +227,7 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.WhereTheFirst(1) .TheFirst(1)
.Has(f => f.EpisodeFileId = 1) .Has(f => f.EpisodeFileId = 1)
.Has(f => f.Path = @"C:\Test\Title1.avi") .Has(f => f.Path = @"C:\Test\Title1.avi")
.AndTheNext(1) .AndTheNext(1)
@ -236,9 +236,9 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(3) var episodes = Builder<Episode>.CreateListOfSize(3)
.WhereAll() .All()
.Have(e => e.Series = series) .With(e => e.Series = series)
.WhereTheFirst(2) .TheFirst(2)
.Has(e => e.EpisodeFileId = 1) .Has(e => e.EpisodeFileId = 1)
.Has(e => e.EpisodeFile = episodeFiles[0]) .Has(e => e.EpisodeFile = episodeFiles[0])
.AndTheNext(1) .AndTheNext(1)

@ -36,8 +36,9 @@
<Reference Include="Accessibility"> <Reference Include="Accessibility">
<EmbedInteropTypes>True</EmbedInteropTypes> <EmbedInteropTypes>True</EmbedInteropTypes>
</Reference> </Reference>
<Reference Include="FizzWare.NBuilder"> <Reference Include="FizzWare.NBuilder, Version=3.0.1.0, Culture=neutral, PublicKeyToken=5651b03e12e42c12, processorArchitecture=MSIL">
<HintPath>..\packages\NBuilder.2.3.0.0\lib\FizzWare.NBuilder.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NBuilder.3.0.1\lib\FizzWare.NBuilder.dll</HintPath>
</Reference> </Reference>
<Reference Include="FluentAssertions"> <Reference Include="FluentAssertions">
<HintPath>..\Libraries\FluentAssertions.dll</HintPath> <HintPath>..\Libraries\FluentAssertions.dll</HintPath>

@ -41,10 +41,10 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(episodeCount) var fakeEpisodes = Builder<Episode>.CreateListOfSize(episodeCount)
.WhereAll() .All()
.Have(c => c.SeriesId = 12345) .With(c => c.SeriesId = 12345)
.Have(c => c.SeasonNumber = 1) .With(c => c.SeasonNumber = 1)
.Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown) .With(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
.Build(); .Build();
var expectedEpisodesNumbers = fakeEpisodes.Select(e => e.EpisodeId).ToList(); var expectedEpisodesNumbers = fakeEpisodes.Select(e => e.EpisodeId).ToList();
@ -200,8 +200,8 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var fakeEpisodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var fakeEpisodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.WhereAll() .All()
.Have(f => f.SeriesId = fakeSeries.SeriesId) .With(f => f.SeriesId = fakeSeries.SeriesId)
.Build().ToList(); .Build().ToList();
//Act //Act
@ -230,8 +230,8 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var fakeEpisodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var fakeEpisodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.WhereAll() .All()
.Have(f => f.SeriesId = fakeSeries.SeriesId) .With(f => f.SeriesId = fakeSeries.SeriesId)
.Build().ToList(); .Build().ToList();
//Act //Act

@ -55,7 +55,7 @@ namespace NzbDrone.Core.Test
public void processResults_higher_quality_should_be_called_first() public void processResults_higher_quality_should_be_called_first()
{ {
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(10) 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)) .WhereRandom(1).Has(c => c.Quality = new Quality(QualityTypes.Bluray1080p, true))
.Build(); .Build();
@ -91,7 +91,7 @@ namespace NzbDrone.Core.Test
public void processResults_when_same_quality_proper_should_be_called_first() public void processResults_when_same_quality_proper_should_be_called_first()
{ {
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(20) 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)) .WhereRandom(1).Has(c => c.Quality = new Quality(QualityTypes.DVD, true))
.Build(); .Build();

@ -30,16 +30,16 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(5) var episodes = Builder<Episode>.CreateListOfSize(5)
.WhereAll() .All()
.Have(e => e.Series = series) .With(e => e.Series = series)
.Have(e => e.SeriesId = 1) .With(e => e.SeriesId = 1)
.Have(e => e.SeasonNumber = 1) .With(e => e.SeasonNumber = 1)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.Build(); .Build();
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
.WhereAll() .All()
.Have(e => e.EpisodeNumbers = Builder<int>.CreateListOfSize(2).Build().ToList()) .With(e => e.EpisodeNumbers = Builder<int>.CreateListOfSize(2).Build().ToList())
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -93,16 +93,16 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(5) var episodes = Builder<Episode>.CreateListOfSize(5)
.WhereAll() .All()
.Have(e => e.Series = series) .With(e => e.Series = series)
.Have(e => e.SeriesId = 1) .With(e => e.SeriesId = 1)
.Have(e => e.SeasonNumber = 1) .With(e => e.SeasonNumber = 1)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.Build(); .Build();
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
.WhereAll() .All()
.Have(e => e.EpisodeNumbers = Builder<int>.CreateListOfSize(2).Build().ToList()) .With(e => e.EpisodeNumbers = Builder<int>.CreateListOfSize(2).Build().ToList())
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -150,9 +150,9 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
.WhereAll() .All()
.Have(e => e.EpisodeNumbers = Builder<int>.CreateListOfSize(2).Build().ToList()) .With(e => e.EpisodeNumbers = Builder<int>.CreateListOfSize(2).Build().ToList())
.Have(e => e.Series = series) .With(e => e.Series = series)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -184,7 +184,7 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
.WhereTheFirst(1) .TheFirst(1)
.Has(p => p.CleanTitle = "title") .Has(p => p.CleanTitle = "title")
.Has(p => p.SeasonNumber = 1) .Has(p => p.SeasonNumber = 1)
.Has(p => p.FullSeason = true) .Has(p => p.FullSeason = true)

@ -30,15 +30,15 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(5) var episodes = Builder<Episode>.CreateListOfSize(5)
.WhereAll() .All()
.Have(e => e.Series = series) .With(e => e.Series = series)
.Have(e => e.SeriesId = 1) .With(e => e.SeriesId = 1)
.Have(e => e.SeasonNumber = 1) .With(e => e.SeasonNumber = 1)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.Build(); .Build();
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
.WhereTheFirst(1) .TheFirst(1)
.Has(p => p.CleanTitle = "title") .Has(p => p.CleanTitle = "title")
.Has(p => p.SeasonNumber = 1) .Has(p => p.SeasonNumber = 1)
.Has(p => p.FullSeason = true) .Has(p => p.FullSeason = true)
@ -95,11 +95,11 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(5) var episodes = Builder<Episode>.CreateListOfSize(5)
.WhereAll() .All()
.Have(e => e.Series = series) .With(e => e.Series = series)
.Have(e => e.SeriesId = 1) .With(e => e.SeriesId = 1)
.Have(e => e.SeasonNumber = 1) .With(e => e.SeasonNumber = 1)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.Build(); .Build();
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
@ -150,7 +150,7 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
.WhereTheFirst(1) .TheFirst(1)
.Has(p => p.CleanTitle = "title") .Has(p => p.CleanTitle = "title")
.Has(p => p.SeasonNumber = 1) .Has(p => p.SeasonNumber = 1)
.Has(p => p.FullSeason = true) .Has(p => p.FullSeason = true)
@ -184,7 +184,7 @@ namespace NzbDrone.Core.Test
.Build(); .Build();
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
.WhereTheFirst(1) .TheFirst(1)
.Has(p => p.CleanTitle = "title") .Has(p => p.CleanTitle = "title")
.Has(p => p.SeasonNumber = 1) .Has(p => p.SeasonNumber = 1)
.Has(p => p.FullSeason = true) .Has(p => p.FullSeason = true)

@ -45,9 +45,9 @@ namespace NzbDrone.Core.Test
public void SeasonSearch_partial_season_success() public void SeasonSearch_partial_season_success()
{ {
var episodes = Builder<Episode>.CreateListOfSize(5) var episodes = Builder<Episode>.CreateListOfSize(5)
.WhereAll() .All()
.Have(e => e.SeriesId = 1) .With(e => e.SeriesId = 1)
.Have(e => e.SeasonNumber = 1) .With(e => e.SeasonNumber = 1)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -78,10 +78,10 @@ namespace NzbDrone.Core.Test
public void SeasonSearch_partial_season_failure() public void SeasonSearch_partial_season_failure()
{ {
var episodes = Builder<Episode>.CreateListOfSize(5) var episodes = Builder<Episode>.CreateListOfSize(5)
.WhereAll() .All()
.Have(e => e.SeriesId = 1) .With(e => e.SeriesId = 1)
.Have(e => e.SeasonNumber = 1) .With(e => e.SeasonNumber = 1)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);

@ -216,13 +216,13 @@ namespace NzbDrone.Core.Test
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build(); var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10) var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
.WhereAll().Have(e => e.SeriesId = fakeSeries.SeriesId) .All().With(e => e.SeriesId = fakeSeries.SeriesId)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.Have(e => e.AirDate = DateTime.Today) .With(e => e.AirDate = DateTime.Today)
.WhereTheFirst(5) .TheFirst(5)
.Have(e => e.EpisodeFileId = 0) .With(e => e.EpisodeFileId = 0)
.WhereTheLast(2) .WhereTheLast(2)
.Have(e => e.AirDate = DateTime.Today.AddDays(1)) .With(e => e.AirDate = DateTime.Today.AddDays(1))
.Build(); .Build();
db.Insert(fakeSeries); db.Insert(fakeSeries);
@ -248,7 +248,7 @@ namespace NzbDrone.Core.Test
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).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(fakeSeries);
db.Insert(fakeQuality); db.Insert(fakeQuality);
@ -274,10 +274,10 @@ namespace NzbDrone.Core.Test
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build(); var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10) var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
.WhereAll() .All()
.Have(e => e.SeriesId = fakeSeries.SeriesId) .With(e => e.SeriesId = fakeSeries.SeriesId)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.Have(e => e.AirDate = DateTime.Today.AddDays(-1)) .With(e => e.AirDate = DateTime.Today.AddDays(-1))
.Build(); .Build();
db.Insert(fakeSeries); db.Insert(fakeSeries);
@ -304,13 +304,13 @@ namespace NzbDrone.Core.Test
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build(); var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10) var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
.WhereAll() .All()
.Have(e => e.SeriesId = fakeSeries.SeriesId) .With(e => e.SeriesId = fakeSeries.SeriesId)
.Have(e => e.AirDate = DateTime.Today.AddDays(-1)) .With(e => e.AirDate = DateTime.Today.AddDays(-1))
.WhereTheFirst(5) .TheFirst(5)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.WhereTheLast(5) .WhereTheLast(5)
.Have(e => e.Ignored = true) .With(e => e.Ignored = true)
.Build(); .Build();
db.Insert(fakeSeries); db.Insert(fakeSeries);
@ -362,10 +362,10 @@ namespace NzbDrone.Core.Test
var path = @"C:\Test\TV\30 Rock"; var path = @"C:\Test\TV\30 Rock";
var fakeSeries = Builder<Series>.CreateListOfSize(10) var fakeSeries = Builder<Series>.CreateListOfSize(10)
.WhereAll() .All()
.Have(c => c.QualityProfileId = 1) .With(c => c.QualityProfileId = 1)
.WhereTheFirst(1) .TheFirst(1)
.Have(c => c.Path = path) .With(c => c.Path = path)
.Build(); .Build();
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
@ -393,10 +393,10 @@ namespace NzbDrone.Core.Test
var path = @"C:\Test\TV\30 Rock"; var path = @"C:\Test\TV\30 Rock";
var fakeSeries = Builder<Series>.CreateListOfSize(10) var fakeSeries = Builder<Series>.CreateListOfSize(10)
.WhereAll() .All()
.Have(c => c.QualityProfileId = 1) .With(c => c.QualityProfileId = 1)
.WhereTheFirst(1) .TheFirst(1)
.Have(c => c.Path = path) .With(c => c.Path = path)
.Build(); .Build();
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
@ -424,10 +424,10 @@ namespace NzbDrone.Core.Test
var path = @"C:\Test\TV\The Simpsons"; var path = @"C:\Test\TV\The Simpsons";
var fakeSeries = Builder<Series>.CreateListOfSize(10) var fakeSeries = Builder<Series>.CreateListOfSize(10)
.WhereAll() .All()
.Have(c => c.QualityProfileId = 1) .With(c => c.QualityProfileId = 1)
.WhereTheFirst(1) .TheFirst(1)
.Have(c => c.Path = path) .With(c => c.Path = path)
.Build(); .Build();
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
@ -455,10 +455,10 @@ namespace NzbDrone.Core.Test
var path = @"C:\Test\TV\30 Rock"; var path = @"C:\Test\TV\30 Rock";
var fakeSeries = Builder<Series>.CreateListOfSize(10) var fakeSeries = Builder<Series>.CreateListOfSize(10)
.WhereAll() .All()
.Have(c => c.QualityProfileId = 1) .With(c => c.QualityProfileId = 1)
.WhereTheFirst(1) .TheFirst(1)
.Have(c => c.Path = path) .With(c => c.Path = path)
.Build(); .Build();
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
@ -486,13 +486,12 @@ namespace NzbDrone.Core.Test
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build(); var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2) var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(e => e.SeriesId = fakeSeries.SeriesId) .With(e => e.SeriesId = fakeSeries.SeriesId)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.WhereTheFirst(1) .With(e => e.AirDate = DateTime.Today.AddDays(1))
.Have(e => e.AirDate = DateTime.Today) .TheFirst(1)
.AndTheRemaining() .With(e => e.AirDate = DateTime.Today)
.Have(e => e.AirDate = DateTime.Today.AddDays(1))
.Build(); .Build();
db.Insert(fakeSeries); db.Insert(fakeSeries);
@ -518,13 +517,12 @@ namespace NzbDrone.Core.Test
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build(); var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2) var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(e => e.SeriesId = fakeSeries.SeriesId) .With(e => e.SeriesId = fakeSeries.SeriesId)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.WhereTheFirst(1) .With(e => e.AirDate = DateTime.Today.AddDays(1))
.Have(e => e.AirDate = DateTime.Today.AddDays(-1)) .TheFirst(1)
.AndTheRemaining() .With(e => e.AirDate = DateTime.Today.AddDays(-1))
.Have(e => e.AirDate = DateTime.Today.AddDays(1))
.Build(); .Build();
db.Insert(fakeSeries); db.Insert(fakeSeries);
@ -550,10 +548,10 @@ namespace NzbDrone.Core.Test
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build(); var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2) var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(e => e.SeriesId = fakeSeries.SeriesId) .With(e => e.SeriesId = fakeSeries.SeriesId)
.Have(e => e.AirDate = null) .With(e => e.AirDate = null)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.Build(); .Build();
db.Insert(fakeSeries); db.Insert(fakeSeries);
@ -579,13 +577,12 @@ namespace NzbDrone.Core.Test
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build(); var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2) var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(e => e.SeriesId = fakeSeries.SeriesId) .With(e => e.SeriesId = fakeSeries.SeriesId)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.WhereTheFirst(1) .With(e => e.AirDate = DateTime.Today.AddMonths(1))
.Have(e => e.AirDate = DateTime.Today.AddDays(-1)) .TheFirst(1)
.AndTheRemaining() .With(e => e.AirDate = DateTime.Today.AddDays(-1))
.Have(e => e.AirDate = DateTime.Today.AddMonths(1))
.Build(); .Build();
db.Insert(fakeSeries); db.Insert(fakeSeries);
@ -611,14 +608,13 @@ namespace NzbDrone.Core.Test
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build(); var fakeSeries = Builder<Series>.CreateNew().With(e => e.QualityProfileId = fakeQuality.QualityProfileId).Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2) var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
.WhereAll() .All()
.Have(e => e.SeriesId = fakeSeries.SeriesId) .With(e => e.SeriesId = fakeSeries.SeriesId)
.WhereTheFirst(1) .With(e => e.AirDate = DateTime.Today.AddMonths(1))
.Have(e => e.AirDate = DateTime.Today.AddDays(1)) .With(e => e.Ignored = false)
.Have(e => e.Ignored = true) .TheFirst(1)
.AndTheRemaining() .With(e => e.AirDate = DateTime.Today.AddDays(1))
.Have(e => e.AirDate = DateTime.Today.AddMonths(1)) .With(e => e.Ignored = true)
.Have(e => e.Ignored = false)
.Build(); .Build();
db.Insert(fakeSeries); db.Insert(fakeSeries);

@ -23,10 +23,10 @@ namespace NzbDrone.Core.Test
public new void Setup() public new void Setup()
{ {
episodes = Builder<Episode>.CreateListOfSize(6) episodes = Builder<Episode>.CreateListOfSize(6)
.WhereAll() .All()
.Have(e => e.SeriesId = 1) .With(e => e.SeriesId = 1)
.Have(e => e.Ignored = false) .With(e => e.Ignored = false)
.WhereTheFirst(1) .TheFirst(1)
.Has(e => e.AirDate = DateTime.Today.AddDays(-1)) .Has(e => e.AirDate = DateTime.Today.AddDays(-1))
.AndTheNext(1) .AndTheNext(1)
.Has(e => e.AirDate = DateTime.Today) .Has(e => e.AirDate = DateTime.Today)

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NBuilder" version="2.3.0.0" />
<package id="AutoMoq" version="1.3.1.3" /> <package id="AutoMoq" version="1.3.1.3" />
<package id="Moq" version="4.0.10827" />
<package id="CommonServiceLocator" version="1.0" /> <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="NUnit" version="2.5.10.11092" />
<package id="SqlServerCompact" version="4.0.8482.1" /> <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> </packages>
Loading…
Cancel
Save