diff --git a/NzbDrone.Core.Test/DecisionEngineTests/AllowedDownloadSpecificationFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/AllowedDownloadSpecificationFixture.cs index 96949311e..b29c009fa 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/AllowedDownloadSpecificationFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/AllowedDownloadSpecificationFixture.cs @@ -47,7 +47,7 @@ public void Setup() private void GivenSpecifications(params Mock[] mocks) { - Mocker.SetConstant(mocks.Select(c => c.Object)); + Mocker.SetConstant>(mocks.Select(c => c.Object)); } [Test] @@ -55,7 +55,7 @@ public void should_call_all_specifications() { GivenSpecifications(_pass1, _pass2, _pass3, _fail1, _fail2, _fail3); - Subject.GetRssDecision(_parseResults); + Subject.GetRssDecision(_parseResults).ToList(); _fail1.Verify(c => c.IsSatisfiedBy(_parseResults[0]), Times.Once()); _fail2.Verify(c => c.IsSatisfiedBy(_parseResults[0]), Times.Once()); diff --git a/NzbDrone.Core.Test/DecisionEngineTests/AllowedReleaseGroupSpecificationFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/AllowedReleaseGroupSpecificationFixture.cs index ad8635965..ee69dfe46 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/AllowedReleaseGroupSpecificationFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/AllowedReleaseGroupSpecificationFixture.cs @@ -1,27 +1,18 @@ - - -using System.Linq; -using System; +using System; using System.Collections.Generic; -using FizzWare.NBuilder; using FluentAssertions; -using Moq; using NUnit.Framework; -using NzbDrone.Core.Configuration; using NzbDrone.Core.DecisionEngine.Specifications; using NzbDrone.Core.Qualities; using NzbDrone.Core.Tv; using NzbDrone.Core.Model; -using NzbDrone.Core.Providers; -using NzbDrone.Core.DecisionEngine; - using NzbDrone.Core.Test.Framework; namespace NzbDrone.Core.Test.DecisionEngineTests { [TestFixture] - - public class AllowedReleaseGroupSpecificationFixture : CoreTest + + public class AllowedReleaseGroupSpecificationFixture : CoreTest { private EpisodeParseResult parseResult; @@ -43,29 +34,25 @@ public void Setup() [Test] public void should_be_true_when_allowedReleaseGroups_is_empty() { - //Mocker.GetMock().SetupGet(s => s.AllowedReleaseGroups).Returns(String.Empty); - Mocker.Resolve().IsSatisfiedBy(parseResult).Should().BeTrue(); + Subject.IsSatisfiedBy(parseResult).Should().BeTrue(); } [Test] public void should_be_true_when_allowedReleaseGroups_is_nzbs_releaseGroup() { - //Mocker.GetMock().SetupGet(s => s.AllowedReleaseGroups).Returns("2HD"); - Mocker.Resolve().IsSatisfiedBy(parseResult).Should().BeTrue(); + Subject.IsSatisfiedBy(parseResult).Should().BeTrue(); } [Test] public void should_be_true_when_allowedReleaseGroups_contains_nzbs_releaseGroup() { - //Mocker.GetMock().SetupGet(s => s.AllowedReleaseGroups).Returns("2HD, LOL"); - Mocker.Resolve().IsSatisfiedBy(parseResult).Should().BeTrue(); + Subject.IsSatisfiedBy(parseResult).Should().BeTrue(); } [Test] public void should_be_false_when_allowedReleaseGroups_does_not_contain_nzbs_releaseGroup() { - //Mocker.GetMock().SetupGet(s => s.AllowedReleaseGroups).Returns("LOL,DTD"); - Mocker.Resolve().IsSatisfiedBy(parseResult).Should().BeFalse(); + Subject.IsSatisfiedBy(parseResult).Should().BeFalse(); } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/Download/DownloadClientTests/BlackholeProviderFixture.cs b/NzbDrone.Core.Test/Download/DownloadClientTests/BlackholeProviderFixture.cs index a0e9a9ca9..72a4394a4 100644 --- a/NzbDrone.Core.Test/Download/DownloadClientTests/BlackholeProviderFixture.cs +++ b/NzbDrone.Core.Test/Download/DownloadClientTests/BlackholeProviderFixture.cs @@ -12,7 +12,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests { [TestFixture] - public class BlackholeProviderFixture : CoreTest + public class BlackholeProviderFixture : CoreTest { private const string nzbUrl = "http://www.nzbs.com/url"; private const string title = "some_nzb_title"; @@ -39,9 +39,9 @@ private void WithFailedDownload() [Test] public void DownloadNzb_should_download_file_if_it_doesnt_exist() { - Mocker.Resolve().DownloadNzb(nzbUrl, title, false).Should().BeTrue(); + Subject.DownloadNzb(nzbUrl, title, false).Should().BeTrue(); - Mocker.GetMock().Verify(c => c.DownloadFile(nzbUrl, nzbPath),Times.Once()); + Mocker.GetMock().Verify(c => c.DownloadFile(nzbUrl, nzbPath), Times.Once()); } [Test] @@ -49,7 +49,7 @@ public void DownloadNzb_not_download_file_if_it_doesn_exist() { WithExistingFile(); - Mocker.Resolve().DownloadNzb(nzbUrl, title, false).Should().BeTrue(); + Subject.DownloadNzb(nzbUrl, title, false).Should().BeTrue(); Mocker.GetMock().Verify(c => c.DownloadFile(It.IsAny(), It.IsAny()), Times.Never()); } @@ -59,8 +59,8 @@ public void should_return_false_on_failed_download() { WithFailedDownload(); - Mocker.Resolve().DownloadNzb(nzbUrl, title, false).Should().BeFalse(); - + Subject.DownloadNzb(nzbUrl, title, false).Should().BeFalse(); + ExceptionVerification.ExpectedWarns(1); } @@ -70,7 +70,7 @@ public void should_replace_illegal_characters_in_title() var illegalTitle = "Saturday Night Live - S38E08 - Jeremy Renner/Maroon 5 [SDTV]"; var expectedFilename = Path.Combine(blackHoleFolder, "Saturday Night Live - S38E08 - Jeremy Renner+Maroon 5 [SDTV].nzb"); - Mocker.Resolve().DownloadNzb(nzbUrl, illegalTitle, false).Should().BeTrue(); + Subject.DownloadNzb(nzbUrl, illegalTitle, false).Should().BeTrue(); Mocker.GetMock().Verify(c => c.DownloadFile(It.IsAny(), expectedFilename), Times.Once()); } diff --git a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj index f7c03b625..905b4905f 100644 --- a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj +++ b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj @@ -230,6 +230,10 @@ + + sqlite3.dll + Always + Always @@ -260,9 +264,6 @@ Always - - PreserveNewest - Always @@ -355,7 +356,8 @@ - xcopy /s /y "$(SolutionDir)\Libraries\Sqlite\*.*" "$(TargetDir)" + +