Replaced deprecated NBuilder calls.

pull/2/head
kay.one 13 years ago
parent 956092dbd4
commit f52620db70

@ -9,7 +9,7 @@ namespace NzbDrone.Core.Test.Framework
{ {
[SetUp] [SetUp]
public void Setup() public virtual void Setup()
{ {
ExceptionVerification.Reset(); ExceptionVerification.Reset();
if (Directory.Exists(TempFolder)) if (Directory.Exists(TempFolder))

@ -54,7 +54,7 @@ namespace NzbDrone.Core.Test.JobTests
{ {
//Setup //Setup
var fakeSeries = Builder<Series>.CreateListOfSize(10) var fakeSeries = Builder<Series>.CreateListOfSize(10)
.WhereRandom(2) .Random(2)
.With(s => s.BannerUrl = null) .With(s => s.BannerUrl = null)
.Build(); .Build();

@ -49,8 +49,8 @@ namespace NzbDrone.Core.Test.JobTests
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)
.TheFirst(1).Has(s => s.SeriesId = 12) .TheFirst(1).With(s => s.SeriesId = 12)
.AndTheNext(1).Has(s => s.SeriesId = 15) .TheNext(1).With(s => s.SeriesId = 15)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -77,8 +77,8 @@ namespace NzbDrone.Core.Test.JobTests
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)
.TheFirst(1).Has(s => s.SeriesId = 12) .TheFirst(1).With(s => s.SeriesId = 12)
.AndTheNext(1).Has(s => s.SeriesId = 15) .TheNext(1).With(s => s.SeriesId = 15)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -106,8 +106,8 @@ namespace NzbDrone.Core.Test.JobTests
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)
.TheFirst(1).Has(s => s.SeriesId = 12) .TheFirst(1).With(s => s.SeriesId = 12)
.AndTheNext(1).Has(s => s.SeriesId = 15) .TheNext(1).With(s => s.SeriesId = 15)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);

@ -23,8 +23,8 @@ namespace NzbDrone.Core.Test.JobTests
{ {
var series = Builder<Series>.CreateListOfSize(2) var series = Builder<Series>.CreateListOfSize(2)
.All().With(s => s.LastInfoSync = null) .All().With(s => s.LastInfoSync = null)
.TheFirst(1).Has(s => s.SeriesId = 12) .TheFirst(1).With(s => s.SeriesId = 12)
.AndTheNext(1).Has(s => s.SeriesId = 15) .TheNext(1).With(s => s.SeriesId = 15)
.Build(); .Build();
var notification = new ProgressNotification("Test"); var notification = new ProgressNotification("Test");
@ -88,8 +88,8 @@ namespace NzbDrone.Core.Test.JobTests
{ {
var series = Builder<Series>.CreateListOfSize(2) var series = Builder<Series>.CreateListOfSize(2)
.All().With(s => s.LastInfoSync = null) .All().With(s => s.LastInfoSync = null)
.TheFirst(1).Has(s => s.SeriesId = 12) .TheFirst(1).With(s => s.SeriesId = 12)
.AndTheNext(1).Has(s => s.SeriesId = 15) .TheNext(1).With(s => s.SeriesId = 15)
.Build(); .Build();
var notification = new ProgressNotification("Test"); var notification = new ProgressNotification("Test");

@ -25,9 +25,9 @@ namespace NzbDrone.Core.Test.ProviderTests
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(2) var episodes = Builder<Episode>.CreateListOfSize(2)
.TheFirst(1).Has(s => s.EpisodeId = 12) .TheFirst(1).With(s => s.EpisodeId = 12)
.AndTheNext(1).Has(s => s.EpisodeId = 99) .TheNext(1).With(s => s.EpisodeId = 99)
.All().Has(s => s.SeriesId = 5) .All().With(s => s.SeriesId = 5)
.Build(); .Build();

@ -338,8 +338,8 @@ namespace NzbDrone.Core.Test.ProviderTests
All() All()
.With(l => l.Language = new TvdbLanguage(0, "eng", "a")) .With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
.TheFirst(1) .TheFirst(1)
.Has(e => e.EpisodeNumber = 0) .With(e => e.EpisodeNumber = 0)
.Has(e => e.SeasonNumber = 15) .With(e => e.SeasonNumber = 15)
.Build()) .Build())
).With(c => c.Id = seriesId).Build(); ).With(c => c.Id = seriesId).Build();
@ -1183,7 +1183,7 @@ namespace NzbDrone.Core.Test.ProviderTests
.With(c => c.Ignored = true) .With(c => c.Ignored = true)
.TheFirst(2) .TheFirst(2)
.With(c => c.EpisodeFileId = 0) .With(c => c.EpisodeFileId = 0)
.WhereSection(1, 2) .Section(1, 2)
.With(c => c.Ignored = false) .With(c => c.Ignored = false)
.Build().ToList(); .Build().ToList();
@ -1230,7 +1230,7 @@ namespace NzbDrone.Core.Test.ProviderTests
.With(c => c.Ignored = true) .With(c => c.Ignored = true)
.TheFirst(2) .TheFirst(2)
.With(c => c.EpisodeFileId = 0) .With(c => c.EpisodeFileId = 0)
.WhereSection(1, 2) .Section(1, 2)
.With(c => c.Ignored = false) .With(c => c.Ignored = false)
.Build().ToList(); .Build().ToList();

@ -44,7 +44,7 @@ namespace NzbDrone.Core.Test.ProviderTests
var episodes = Builder<Episode>.CreateListOfSize(10).Build(); var episodes = Builder<Episode>.CreateListOfSize(10).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 historyItems = Builder<History>.CreateListOfSize(10).TheFirst(5).With(h => h.SeriesId = seriesOne.SeriesId).TheLast(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,7 +95,7 @@ namespace NzbDrone.Core.Test.ProviderTests
//Setup //Setup
var historyItem = Builder<History>.CreateListOfSize(20) var historyItem = Builder<History>.CreateListOfSize(20)
.TheFirst(10).With(c => c.Date = DateTime.Now) .TheFirst(10).With(c => c.Date = DateTime.Now)
.AndTheNext(10).With(c => c.Date = DateTime.Now.AddDays(-31)) .TheNext(10).With(c => c.Date = DateTime.Now.AddDays(-31))
.Build(); .Build();
var mocker = new AutoMoqer(); var mocker = new AutoMoqer();

@ -18,8 +18,9 @@ namespace NzbDrone.Core.Test.ProviderTests
public class JobProviderTest : TestBase public class JobProviderTest : TestBase
{ {
[TestFixtureSetUp] [TestFixtureSetUp]
public void Setup() public override void Setup()
{ {
base.Setup();
JobProvider.Queue.Clear(); JobProvider.Queue.Clear();
} }
@ -415,7 +416,7 @@ namespace NzbDrone.Core.Test.ProviderTests
TargetId = 12, TargetId = 12,
SecondaryTargetId = 0 SecondaryTargetId = 0
}; };
//Act //Act
var jobProvider = mocker.Resolve<JobProvider>(); var jobProvider = mocker.Resolve<JobProvider>();
jobProvider.Initialize(); jobProvider.Initialize();

@ -23,22 +23,22 @@ namespace NzbDrone.Core.Test.ProviderTests
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.TheFirst(1) .TheFirst(1)
.Has(f => f.EpisodeFileId = 1) .With(f => f.EpisodeFileId = 1)
.Has(f => f.Path = @"C:\Test\Title1.avi") .With(f => f.Path = @"C:\Test\Title1.avi")
.AndTheNext(1) .TheNext(1)
.Has(f => f.EpisodeFileId = 2) .With(f => f.EpisodeFileId = 2)
.Has(f => f.Path = @"C:\Test\Title2.avi") .With(f => f.Path = @"C:\Test\Title2.avi")
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(2) var episodes = Builder<Episode>.CreateListOfSize(2)
.All() .All()
.With(e => e.Series = series) .With(e => e.Series = series)
.TheFirst(1) .TheFirst(1)
.Has(e => e.EpisodeFileId = 1) .With(e => e.EpisodeFileId = 1)
.Has(e => e.EpisodeFile = episodeFiles[0]) .With(e => e.EpisodeFile = episodeFiles[0])
.AndTheNext(1) .TheNext(1)
.Has(e => e.EpisodeFileId = 2) .With(e => e.EpisodeFileId = 2)
.Has(e => e.EpisodeFile = episodeFiles[1]) .With(e => e.EpisodeFile = episodeFiles[1])
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -72,22 +72,22 @@ namespace NzbDrone.Core.Test.ProviderTests
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.TheFirst(1) .TheFirst(1)
.Has(f => f.EpisodeFileId = 1) .With(f => f.EpisodeFileId = 1)
.Has(f => f.Path = @"C:\Test\Title1.avi") .With(f => f.Path = @"C:\Test\Title1.avi")
.AndTheNext(1) .TheNext(1)
.Has(f => f.EpisodeFileId = 2) .With(f => f.EpisodeFileId = 2)
.Has(f => f.Path = @"C:\Test\Title2.avi") .With(f => f.Path = @"C:\Test\Title2.avi")
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(2) var episodes = Builder<Episode>.CreateListOfSize(2)
.All() .All()
.With(e => e.Series = series) .With(e => e.Series = series)
.TheFirst(1) .TheFirst(1)
.Has(e => e.EpisodeFileId = 1) .With(e => e.EpisodeFileId = 1)
.Has(e => e.EpisodeFile = episodeFiles[0]) .With(e => e.EpisodeFile = episodeFiles[0])
.AndTheNext(1) .TheNext(1)
.Has(e => e.EpisodeFileId = 2) .With(e => e.EpisodeFileId = 2)
.Has(e => e.EpisodeFile = episodeFiles[1]) .With(e => e.EpisodeFile = episodeFiles[1])
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -121,22 +121,22 @@ namespace NzbDrone.Core.Test.ProviderTests
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.TheFirst(1) .TheFirst(1)
.Has(f => f.EpisodeFileId = 1) .With(f => f.EpisodeFileId = 1)
.Has(f => f.Path = @"C:\Test\Title1.avi") .With(f => f.Path = @"C:\Test\Title1.avi")
.AndTheNext(1) .TheNext(1)
.Has(f => f.EpisodeFileId = 2) .With(f => f.EpisodeFileId = 2)
.Has(f => f.Path = @"C:\Test\Title2.avi") .With(f => f.Path = @"C:\Test\Title2.avi")
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(2) var episodes = Builder<Episode>.CreateListOfSize(2)
.All() .All()
.With(e => e.Series = series) .With(e => e.Series = series)
.TheFirst(1) .TheFirst(1)
.Has(e => e.EpisodeFileId = 1) .With(e => e.EpisodeFileId = 1)
.Has(e => e.EpisodeFile = episodeFiles[0]) .With(e => e.EpisodeFile = episodeFiles[0])
.AndTheNext(1) .TheNext(1)
.Has(e => e.EpisodeFileId = 2) .With(e => e.EpisodeFileId = 2)
.Has(e => e.EpisodeFile = episodeFiles[1]) .With(e => e.EpisodeFile = episodeFiles[1])
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -172,22 +172,22 @@ namespace NzbDrone.Core.Test.ProviderTests
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.TheFirst(1) .TheFirst(1)
.Has(f => f.EpisodeFileId = 1) .With(f => f.EpisodeFileId = 1)
.Has(f => f.Path = @"C:\Test\Title1.avi") .With(f => f.Path = @"C:\Test\Title1.avi")
.AndTheNext(1) .TheNext(1)
.Has(f => f.EpisodeFileId = 2) .With(f => f.EpisodeFileId = 2)
.Has(f => f.Path = @"C:\Test\Title2.avi") .With(f => f.Path = @"C:\Test\Title2.avi")
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(3) var episodes = Builder<Episode>.CreateListOfSize(3)
.All() .All()
.With(e => e.Series = series) .With(e => e.Series = series)
.TheFirst(2) .TheFirst(2)
.Has(e => e.EpisodeFileId = 1) .With(e => e.EpisodeFileId = 1)
.Has(e => e.EpisodeFile = episodeFiles[0]) .With(e => e.EpisodeFile = episodeFiles[0])
.AndTheNext(1) .TheNext(1)
.Has(e => e.EpisodeFileId = 2) .With(e => e.EpisodeFileId = 2)
.Has(e => e.EpisodeFile = episodeFiles[1]) .With(e => e.EpisodeFile = episodeFiles[1])
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -223,22 +223,22 @@ namespace NzbDrone.Core.Test.ProviderTests
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2) var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.TheFirst(1) .TheFirst(1)
.Has(f => f.EpisodeFileId = 1) .With(f => f.EpisodeFileId = 1)
.Has(f => f.Path = @"C:\Test\Title1.avi") .With(f => f.Path = @"C:\Test\Title1.avi")
.AndTheNext(1) .TheNext(1)
.Has(f => f.EpisodeFileId = 2) .With(f => f.EpisodeFileId = 2)
.Has(f => f.Path = @"C:\Test\Title2.avi") .With(f => f.Path = @"C:\Test\Title2.avi")
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(3) var episodes = Builder<Episode>.CreateListOfSize(3)
.All() .All()
.With(e => e.Series = series) .With(e => e.Series = series)
.TheFirst(2) .TheFirst(2)
.Has(e => e.EpisodeFileId = 1) .With(e => e.EpisodeFileId = 1)
.Has(e => e.EpisodeFile = episodeFiles[0]) .With(e => e.EpisodeFile = episodeFiles[0])
.AndTheNext(1) .TheNext(1)
.Has(e => e.EpisodeFileId = 2) .With(e => e.EpisodeFileId = 2)
.Has(e => e.EpisodeFile = episodeFiles[1]) .With(e => e.EpisodeFile = episodeFiles[1])
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);

@ -55,7 +55,7 @@ namespace NzbDrone.Core.Test.ProviderTests
{ {
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(10) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(10)
.All().With(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)) .Random(1).With(c => c.Quality = new Quality(QualityTypes.Bluray1080p, true))
.Build(); .Build();
var episode = Builder<Episode>.CreateNew().Build(); var episode = Builder<Episode>.CreateNew().Build();
@ -91,7 +91,7 @@ namespace NzbDrone.Core.Test.ProviderTests
{ {
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(20) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(20)
.All().With(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)) .Random(1).With(c => c.Quality = new Quality(QualityTypes.DVD, true))
.Build(); .Build();
parseResults.Where(c => c.Quality.Proper).Should().HaveCount(1); parseResults.Where(c => c.Quality.Proper).Should().HaveCount(1);

@ -183,10 +183,10 @@ namespace NzbDrone.Core.Test.ProviderTests
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
.TheFirst(1) .TheFirst(1)
.Has(p => p.CleanTitle = "title") .With(p => p.CleanTitle = "title")
.Has(p => p.SeasonNumber = 1) .With(p => p.SeasonNumber = 1)
.Has(p => p.FullSeason = true) .With(p => p.FullSeason = true)
.Has(p => p.EpisodeNumbers = null) .With(p => p.EpisodeNumbers = null)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);

@ -37,10 +37,10 @@ namespace NzbDrone.Core.Test.ProviderTests
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
.TheFirst(1) .TheFirst(1)
.Has(p => p.CleanTitle = "title") .With(p => p.CleanTitle = "title")
.Has(p => p.SeasonNumber = 1) .With(p => p.SeasonNumber = 1)
.Has(p => p.FullSeason = true) .With(p => p.FullSeason = true)
.Has(p => p.EpisodeNumbers = null) .With(p => p.EpisodeNumbers = null)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -149,10 +149,10 @@ namespace NzbDrone.Core.Test.ProviderTests
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
.TheFirst(1) .TheFirst(1)
.Has(p => p.CleanTitle = "title") .With(p => p.CleanTitle = "title")
.Has(p => p.SeasonNumber = 1) .With(p => p.SeasonNumber = 1)
.Has(p => p.FullSeason = true) .With(p => p.FullSeason = true)
.Has(p => p.EpisodeNumbers = null) .With(p => p.EpisodeNumbers = null)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);
@ -183,10 +183,10 @@ namespace NzbDrone.Core.Test.ProviderTests
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(4)
.TheFirst(1) .TheFirst(1)
.Has(p => p.CleanTitle = "title") .With(p => p.CleanTitle = "title")
.Has(p => p.SeasonNumber = 1) .With(p => p.SeasonNumber = 1)
.Has(p => p.FullSeason = true) .With(p => p.FullSeason = true)
.Has(p => p.EpisodeNumbers = null) .With(p => p.EpisodeNumbers = null)
.Build(); .Build();
var mocker = new AutoMoqer(MockBehavior.Strict); var mocker = new AutoMoqer(MockBehavior.Strict);

@ -220,7 +220,7 @@ namespace NzbDrone.Core.Test.ProviderTests
.With(e => e.AirDate = DateTime.Today) .With(e => e.AirDate = DateTime.Today)
.TheFirst(5) .TheFirst(5)
.With(e => e.EpisodeFileId = 0) .With(e => e.EpisodeFileId = 0)
.WhereTheLast(2) .TheLast(2)
.With(e => e.AirDate = DateTime.Today.AddDays(1)) .With(e => e.AirDate = DateTime.Today.AddDays(1))
.Build(); .Build();
@ -247,7 +247,7 @@ namespace NzbDrone.Core.Test.ProviderTests
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).All().With(e => e.SeriesId = fakeSeries.SeriesId).With(e => e.Ignored = true).WhereRandom(5).With(e => e.EpisodeFileId = 0).Build(); var fakeEpisodes = Builder<Episode>.CreateListOfSize(10).All().With(e => e.SeriesId = fakeSeries.SeriesId).With(e => e.Ignored = true).Random(5).With(e => e.EpisodeFileId = 0).Build();
db.Insert(fakeSeries); db.Insert(fakeSeries);
db.Insert(fakeQuality); db.Insert(fakeQuality);
@ -308,7 +308,7 @@ namespace NzbDrone.Core.Test.ProviderTests
.With(e => e.AirDate = DateTime.Today.AddDays(-1)) .With(e => e.AirDate = DateTime.Today.AddDays(-1))
.TheFirst(5) .TheFirst(5)
.With(e => e.Ignored = false) .With(e => e.Ignored = false)
.WhereTheLast(5) .TheLast(5)
.With(e => e.Ignored = true) .With(e => e.Ignored = true)
.Build(); .Build();
@ -638,8 +638,8 @@ namespace NzbDrone.Core.Test.ProviderTests
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateListOfSize(10) var fakeSeries = Builder<Series>.CreateListOfSize(10)
.WhereAll() .All()
.Have(e => e.QualityProfileId = fakeQuality.QualityProfileId) .With(e => e.QualityProfileId = fakeQuality.QualityProfileId)
.Build(); .Build();
db.InsertMany(fakeSeries); db.InsertMany(fakeSeries);
@ -661,8 +661,8 @@ namespace NzbDrone.Core.Test.ProviderTests
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateListOfSize(10) var fakeSeries = Builder<Series>.CreateListOfSize(10)
.WhereAll() .All()
.Have(e => e.QualityProfileId = fakeQuality.QualityProfileId) .With(e => e.QualityProfileId = fakeQuality.QualityProfileId)
.Build(); .Build();
db.InsertMany(fakeSeries); db.InsertMany(fakeSeries);
@ -684,8 +684,8 @@ namespace NzbDrone.Core.Test.ProviderTests
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateListOfSize(10) var fakeSeries = Builder<Series>.CreateListOfSize(10)
.WhereAll() .All()
.Have(e => e.QualityProfileId = fakeQuality.QualityProfileId) .With(e => e.QualityProfileId = fakeQuality.QualityProfileId)
.Build(); .Build();
db.InsertMany(fakeSeries); db.InsertMany(fakeSeries);
@ -707,8 +707,8 @@ namespace NzbDrone.Core.Test.ProviderTests
var fakeQuality = Builder<QualityProfile>.CreateNew().Build(); var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateListOfSize(10) var fakeSeries = Builder<Series>.CreateListOfSize(10)
.WhereAll() .All()
.Have(e => e.QualityProfileId = fakeQuality.QualityProfileId) .With(e => e.QualityProfileId = fakeQuality.QualityProfileId)
.Build(); .Build();
db.InsertMany(fakeSeries); db.InsertMany(fakeSeries);

@ -28,17 +28,17 @@ namespace NzbDrone.Core.Test.ProviderTests
.With(e => e.SeriesId = 1) .With(e => e.SeriesId = 1)
.With(e => e.Ignored = false) .With(e => e.Ignored = false)
.TheFirst(1) .TheFirst(1)
.Has(e => e.AirDate = DateTime.Today.AddDays(-1)) .With(e => e.AirDate = DateTime.Today.AddDays(-1))
.AndTheNext(1) .TheNext(1)
.Has(e => e.AirDate = DateTime.Today) .With(e => e.AirDate = DateTime.Today)
.AndTheNext(1) .TheNext(1)
.Has(e => e.AirDate = DateTime.Today.AddDays(1)) .With(e => e.AirDate = DateTime.Today.AddDays(1))
.AndTheNext(1) .TheNext(1)
.Has(e => e.AirDate = DateTime.Today.AddDays(2)) .With(e => e.AirDate = DateTime.Today.AddDays(2))
.AndTheNext(1) .TheNext(1)
.Has(e => e.AirDate = DateTime.Today.AddDays(7)) .With(e => e.AirDate = DateTime.Today.AddDays(7))
.AndTheNext(1) .TheNext(1)
.Has(e => e.AirDate = DateTime.Today.AddDays(9)) .With(e => e.AirDate = DateTime.Today.AddDays(9))
.Build(); .Build();
series = Builder<Series>.CreateNew().With(s => s.SeriesId = 1).Build(); series = Builder<Series>.CreateNew().With(s => s.SeriesId = 1).Build();

Loading…
Cancel
Save