From 72e8b3ce7dac5cc05608cb7355f24c50cfa76d19 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Mon, 25 Apr 2011 17:43:34 -0700 Subject: [PATCH] fixed broken tests --- NzbDrone.Core.Test/MediaFileProviderTests.cs | 14 +++++++------- NzbDrone.Core.Test/ParserTest.cs | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/NzbDrone.Core.Test/MediaFileProviderTests.cs b/NzbDrone.Core.Test/MediaFileProviderTests.cs index 5edce8ae7..d6764f6ca 100644 --- a/NzbDrone.Core.Test/MediaFileProviderTests.cs +++ b/NzbDrone.Core.Test/MediaFileProviderTests.cs @@ -152,8 +152,8 @@ namespace NzbDrone.Core.Test .Setup(r => r.Exists(It.IsAny>>())).Returns(true).Verifiable(); //mocker.GetMock() - // .Setup(e => e.GetEpisode(fakeSeries.SeriesId, seasonNumber, episodeNumner)).Returns(fakeEpisode) - // .Verifiable(); + // .Setup(e => e.GetEpisode(fakeSeries.SeriesId, seasonNumber, episodeNumner)).Returns(fakeEpisode) + // .Verifiable(); mocker.GetMock() .Setup(e => e.GetSize(fileName)).Returns(size).Verifiable(); @@ -224,18 +224,17 @@ namespace NzbDrone.Core.Test mocker.GetMock(MockBehavior.Strict) .Setup(r => r.Exists(It.IsAny>>())).Returns(true).Verifiable(); mocker.GetMock(MockBehavior.Strict); - mocker.GetMock(MockBehavior.Strict); + mocker.GetMock() + .Setup(e => e.GetSize(fileName)).Returns(500000).Verifiable(); //Act var result = mocker.Resolve().ImportFile(fakeSeries, fileName); //Assert - mocker.GetMock().VerifyAll(); - mocker.GetMock().VerifyAll(); - mocker.GetMock(MockBehavior.Strict).VerifyAll(); Assert.IsNull(result); mocker.GetMock().Verify(r => r.Add(result), Times.Never()); + mocker.VerifyAllMocks(); } [Test] @@ -262,7 +261,8 @@ namespace NzbDrone.Core.Test .Setup(e => e.GetEpisode(fakeSeries.SeriesId, seasonNumber, episodeNumner)).Returns(null). Verifiable(); - mocker.GetMock(MockBehavior.Strict); + mocker.GetMock(MockBehavior.Strict) + .Setup(e => e.GetSize(fileName)).Returns(90000000000); //Act diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index 7ac5bbb47..37c0b1929 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -112,16 +112,16 @@ namespace NzbDrone.Core.Test [Row("The Tonight Show With Jay Leno 2011 04 15 1080i HDTV DD5 1 MPEG2 TrollHD", "The Tonight Show With Jay Leno", 2011, 04, 15)] [Row("The.Daily.Show.2010.10.11.Johnny.Knoxville.iTouch-MW", "The.Daily.Show", 2010, 10, 11)] [Row("The Daily Show - 2011-04-12 - Gov. Deval Patrick", "The.Daily.Show", 2011, 04, 12)] - [Row("2011.01.10 - Denis Leary - HD TV.mkv", 2011, 1, 10)] - [Row("2011.03.13 - Denis Leary - HD TV.mkv", 2011, 3, 13)] - [Row("2011-03-13 - Denis Leary - HD TV.mkv", 2011, 3, 13)] + [Row("2011.01.10 - Denis Leary - HD TV.mkv","", 2011, 1, 10)] + [Row("2011.03.13 - Denis Leary - HD TV.mkv", "", 2011, 3, 13)] + [Row("2011-03-13 - Denis Leary - HD TV.mkv", "", 2011, 3, 13)] public void episode_daily_parse(string postTitle, string title, int year, int month, int day) { var result = Parser.ParseEpisodeInfo(postTitle); var airDate = new DateTime(year, month, day); Assert.AreEqual(Parser.NormalizeTitle(title), result.CleanTitle); Assert.AreEqual(airDate, result.AirDate); - Assert.IsEmpty(result.Episodes); + Assert.IsNull(result.Episodes); } [Test]