|
|
|
@ -1,5 +1,4 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using System.ServiceModel.Syndication;
|
|
|
|
@ -17,7 +16,6 @@ using NzbDrone.Core.Repository.Quality;
|
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
using NzbDrone.Core.Test.ProviderTests;
|
|
|
|
|
using NzbDrone.Test.Common;
|
|
|
|
|
using NzbDrone.Test.Common.AutoMoq;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test
|
|
|
|
|
{
|
|
|
|
@ -88,7 +86,6 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
[Test]
|
|
|
|
|
public void newzbin_rss_fetch()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Mocker.Resolve<HttpProvider>();
|
|
|
|
|
var fakeSettings = Builder<IndexerDefinition>.CreateNew().Build();
|
|
|
|
|
Mocker.GetMock<IndexerProvider>()
|
|
|
|
@ -117,7 +114,7 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
parseResults.Should().OnlyContain(s => s.Indexer == newzbinProvider.Name);
|
|
|
|
|
parseResults.Should().OnlyContain(s => !String.IsNullOrEmpty(s.OriginalString));
|
|
|
|
|
|
|
|
|
|
ExceptionVerification.MarkInconclusive(typeof(WebException));
|
|
|
|
|
Mark503Inconclusive();
|
|
|
|
|
ExceptionVerification.IgnoreWarns();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -125,8 +122,6 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
[TestCase("Adventure.Inc.S03E19.DVDRip.XviD-OSiTV", 3, 19, QualityTypes.DVD)]
|
|
|
|
|
public void custome_parser_partial_success(string title, int season, int episode, QualityTypes quality)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const string summary = "My fake summary";
|
|
|
|
|
|
|
|
|
|
var fakeSettings = Builder<IndexerDefinition>.CreateNew().Build();
|
|
|
|
@ -152,8 +147,6 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
[TestCase("Adventure.Inc.DVDRip.XviD-OSiTV")]
|
|
|
|
|
public void custome_parser_full_parse(string title)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const string summary = "My fake summary";
|
|
|
|
|
|
|
|
|
|
var fakeSettings = Builder<IndexerDefinition>.CreateNew().Build();
|
|
|
|
@ -176,7 +169,6 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
[Test]
|
|
|
|
|
public void downloadFeed()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Mocker.SetConstant(new HttpProvider());
|
|
|
|
|
|
|
|
|
|
var fakeSettings = Builder<IndexerDefinition>.CreateNew().Build();
|
|
|
|
@ -206,7 +198,7 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
|
|
|
|
|
var result = Mocker.Resolve<NzbsOrg>().FetchEpisode(title, season, episode);
|
|
|
|
|
|
|
|
|
|
ExceptionVerification.MarkInconclusive(typeof(WebException));
|
|
|
|
|
Mark503Inconclusive();
|
|
|
|
|
|
|
|
|
|
result.Should().NotBeEmpty();
|
|
|
|
|
result.Should().OnlyContain(r => r.SeasonNumber == season);
|
|
|
|
@ -220,8 +212,6 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
[TestCase("In plain Sight", 1, 11, Ignore = true)]
|
|
|
|
|
public void newzbin_search_returns_valid_results(string title, int season, int episode)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<ConfigProvider>()
|
|
|
|
|
.SetupGet(c => c.NewzbinUsername)
|
|
|
|
|
.Returns("nzbdrone");
|
|
|
|
@ -234,21 +224,16 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
|
|
|
|
|
var result = Mocker.Resolve<Newzbin>().FetchEpisode(title, season, episode);
|
|
|
|
|
|
|
|
|
|
ExceptionVerification.MarkInconclusive(typeof(WebException));
|
|
|
|
|
ExceptionVerification.IgnoreWarns();
|
|
|
|
|
Mark503Inconclusive();
|
|
|
|
|
result.Should().NotBeEmpty();
|
|
|
|
|
result.Should().OnlyContain(r => r.CleanTitle == Parser.NormalizeTitle(title));
|
|
|
|
|
result.Should().OnlyContain(r => r.SeasonNumber == season);
|
|
|
|
|
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(episode));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void nzbmatrix_search_returns_valid_results()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<ConfigProvider>()
|
|
|
|
|
.SetupGet(c => c.NzbMatrixUsername)
|
|
|
|
|
.Returns("");
|
|
|
|
@ -261,7 +246,7 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
|
|
|
|
|
var result = Mocker.Resolve<NzbMatrix>().FetchEpisode("Simpsons", 21, 23);
|
|
|
|
|
|
|
|
|
|
ExceptionVerification.MarkInconclusive(typeof(WebException));
|
|
|
|
|
Mark503Inconclusive();
|
|
|
|
|
|
|
|
|
|
result.Should().NotBeEmpty();
|
|
|
|
|
result.Should().OnlyContain(r => r.CleanTitle == "simpsons");
|
|
|
|
@ -287,7 +272,7 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
|
|
|
|
|
var result = Mocker.Resolve<NzbMatrix>().FetchEpisode("Blue Bloods", 1, 19);
|
|
|
|
|
|
|
|
|
|
ExceptionVerification.MarkInconclusive(typeof(WebException));
|
|
|
|
|
Mark503Inconclusive();
|
|
|
|
|
|
|
|
|
|
result.Should().NotBeEmpty();
|
|
|
|
|
result.Should().OnlyContain(r => r.CleanTitle == "bluebloods");
|
|
|
|
@ -309,9 +294,6 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
[Test]
|
|
|
|
|
public void size_newzbin()
|
|
|
|
|
{
|
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<HttpProvider>()
|
|
|
|
|
.Setup(h => h.DownloadStream(It.IsAny<String>(), It.IsAny<NetworkCredential>()))
|
|
|
|
|
.Returns(File.OpenRead(".\\Files\\Rss\\SizeParsing\\newzbin.xml"));
|
|
|
|
@ -401,10 +383,10 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
ExceptionVerification.ExpectedWarns(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TearDown]
|
|
|
|
|
public void TearDown()
|
|
|
|
|
private static void Mark503Inconclusive()
|
|
|
|
|
{
|
|
|
|
|
ExceptionVerification.MarkInconclusive(typeof(WebException));
|
|
|
|
|
ExceptionVerification.MarkInconclusive("The remote server returned an error: (503) Server Unavailable.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|