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 @@ public void import_existing_season_file() .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 @@ public void import_existing_file() 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 @@ public void import_file_with_no_episode() .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 @@ public void episode_multipart_parse(string postTitle, string title, int season, [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]