From 4ddd1a0f6f98c4729fd7cbb07cd0f7c670154527 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 30 Nov 2011 17:10:36 -0800 Subject: [PATCH] Using RealDb instead of Mocked DB. --- .../EpisodeProviderTest_GetEpisodesByParseResult.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/NzbDrone.Core.Test/ProviderTests/EpisodeProviderTest_GetEpisodesByParseResult.cs b/NzbDrone.Core.Test/ProviderTests/EpisodeProviderTest_GetEpisodesByParseResult.cs index 0db4ffd3b..cb59121d1 100644 --- a/NzbDrone.Core.Test/ProviderTests/EpisodeProviderTest_GetEpisodesByParseResult.cs +++ b/NzbDrone.Core.Test/ProviderTests/EpisodeProviderTest_GetEpisodesByParseResult.cs @@ -290,16 +290,12 @@ namespace NzbDrone.Core.Test.ProviderTests public void GetEpisodeParseResult_get_daily_should_add_new_episode() { //Setup + WithRealDb(); + var fakeSeries = Builder.CreateNew() .With(s => s.SeriesId = 1) .Build(); - Mocker.GetMock().Setup(s => s.Fetch(It.IsAny(), It.IsAny())) - .Returns(new List()); - - Mocker.GetMock().Setup(s => s.Insert(It.IsAny())) - .Returns(1); - //Act var episodes = Mocker.Resolve() .GetEpisodesByParseResult(new EpisodeParseResult { AirDate = DateTime.Today, Series = fakeSeries }, true); @@ -308,7 +304,9 @@ namespace NzbDrone.Core.Test.ProviderTests episodes.Should().HaveCount(1); episodes.First().AirDate.Should().Be(DateTime.Today); - Mocker.GetMock().Verify(v => v.Insert(It.IsAny()), Times.Once()); + var episodesInDb = Db.Fetch(); + + episodesInDb.Should().HaveCount(1); } } } \ No newline at end of file