From 2a316e0b989ba5c708efbaf3cdc7d7a2a42e06c5 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 6 Aug 2012 12:10:41 -0700 Subject: [PATCH] Added test for Newzbin release group --- .../Files/RSS/SizeParsing/newzbin.xml | 4 ++-- NzbDrone.Core.Test/Files/RSS/newzbin.xml | 2 +- NzbDrone.Core.Test/IndexerTests.cs | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/NzbDrone.Core.Test/Files/RSS/SizeParsing/newzbin.xml b/NzbDrone.Core.Test/Files/RSS/SizeParsing/newzbin.xml index 220f672d2..502d1b85f 100644 --- a/NzbDrone.Core.Test/Files/RSS/SizeParsing/newzbin.xml +++ b/NzbDrone.Core.Test/Files/RSS/SizeParsing/newzbin.xml @@ -1,6 +1,6 @@  +xmlns:report="http://www.newzbin2.es/DTD/2007/feeds/report/"> www.newzbin.com (reports) http://www.newzbin.com/browse/category/p/tv/ @@ -63,7 +63,7 @@ xmlns:report="http://www.newzbin.com/DTD/2007/feeds/report/"> http://www.tvrage.com/Rookie_Blue/episodes/1064943067/1x10/ 373966350 - tvp-rookieblue-s01e10-720p.nfo + rookieblue-s01e10-720p-tvp.nfo http://www.newzbin.com/nfo/view/txt/373966350/ http://www.newzbin.com/browse/post/6076287/nzb/ diff --git a/NzbDrone.Core.Test/Files/RSS/newzbin.xml b/NzbDrone.Core.Test/Files/RSS/newzbin.xml index 99b5bb09d..909632fb9 100644 --- a/NzbDrone.Core.Test/Files/RSS/newzbin.xml +++ b/NzbDrone.Core.Test/Files/RSS/newzbin.xml @@ -1,6 +1,6 @@  +xmlns:report="http://www.newzbin2.es/DTD/2007/feeds/report/"> www.newzbin.com (reports) http://www.newzbin.com/browse/category/p/tv/ diff --git a/NzbDrone.Core.Test/IndexerTests.cs b/NzbDrone.Core.Test/IndexerTests.cs index c51defcee..d843dac5c 100644 --- a/NzbDrone.Core.Test/IndexerTests.cs +++ b/NzbDrone.Core.Test/IndexerTests.cs @@ -692,5 +692,21 @@ namespace NzbDrone.Core.Test episodeParseResult.NzbInfoUrl.Should().Contain(expectedString); } } + + [Test] + public void releaseGroup_should_use_nfo_filename_for_newzbin() + { + WithConfiguredIndexers(); + + Mocker.GetMock() + .Setup(h => h.DownloadStream(It.IsAny(), It.IsAny())) + .Returns(File.OpenRead(".\\Files\\Rss\\SizeParsing\\newzbin.xml")); + + //Act + var parseResults = Mocker.Resolve().FetchRss(); + + parseResults.Should().HaveCount(1); + parseResults[0].ReleaseGroup.Should().Be("tvp"); + } } }