From 4d442ba1e5ea4d19204a3f063dfe38b8adb52747 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Fri, 20 May 2011 19:06:56 -0700 Subject: [PATCH] fixed broken test --- NzbDrone.Core.Test/MediaFileProviderTests.cs | 22 ++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/NzbDrone.Core.Test/MediaFileProviderTests.cs b/NzbDrone.Core.Test/MediaFileProviderTests.cs index d074790c9..6b8935116 100644 --- a/NzbDrone.Core.Test/MediaFileProviderTests.cs +++ b/NzbDrone.Core.Test/MediaFileProviderTests.cs @@ -29,9 +29,9 @@ namespace NzbDrone.Core.Test ///////////////////////////////////////// //Constants - const string fileName = @"WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD.avi"; + const string fileName = @"WEEDS.S03E01.DUAL.BDRip.XviD.AC3.-HELLYWOOD.avi"; const int seasonNumber = 3; - const int episodeNumner = 01; + const int episodeNumner = 1; const int size = 12345; //Fakes @@ -41,17 +41,19 @@ namespace NzbDrone.Core.Test //Mocks var mocker = new AutoMoqer(); + mocker.GetMock() + .Setup(e => e.GetSize(fileName)).Returns(12345).Verifiable(); + mocker.GetMock() .Setup(r => r.Exists(It.IsAny>>())).Returns(false).Verifiable(); + mocker.GetMock() .Setup(r => r.Add(It.IsAny())).Returns(0).Verifiable(); mocker.GetMock() - .Setup(e => e.GetEpisode(fakeSeries.SeriesId, seasonNumber, episodeNumner)).Returns(fakeEpisode). - Verifiable(); + .Setup(e => e.GetEpisode(fakeSeries.SeriesId, seasonNumber, episodeNumner)).Returns(fakeEpisode); + - mocker.GetMock() - .Setup(e => e.GetSize(fileName)).Returns(12345).Verifiable(); //Act @@ -59,14 +61,8 @@ namespace NzbDrone.Core.Test //Assert Assert.IsNotNull(result); - mocker.GetMock().VerifyAll(); mocker.GetMock().Verify(r => r.Add(result), Times.Once()); - mocker.GetMock().VerifyAll(); - mocker.GetMock().VerifyAll(); - - //Currently can't verify this since the list of episodes are loaded - //Dynamically by SubSonic - //Assert.AreEqual(fakeEpisode, result.Episodes[0]); + mocker.VerifyAllMocks(); Assert.AreEqual(fakeEpisode.SeriesId, result.SeriesId); Assert.AreEqual(QualityTypes.BDRip, result.Quality);