fixed some broken tests.
This commit is contained in:
parent
554924a522
commit
a98d792c0d
|
@ -43,28 +43,28 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||||
[Test]
|
[Test]
|
||||||
public void should_be_true_when_allowedReleaseGroups_is_empty()
|
public void should_be_true_when_allowedReleaseGroups_is_empty()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.AllowedReleaseGroups).Returns(String.Empty);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.AllowedReleaseGroups).Returns(String.Empty);
|
||||||
Mocker.Resolve<AllowedReleaseGroupSpecification>().IsSatisfiedBy(parseResult).Should().BeTrue();
|
Mocker.Resolve<AllowedReleaseGroupSpecification>().IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void should_be_true_when_allowedReleaseGroups_is_nzbs_releaseGroup()
|
public void should_be_true_when_allowedReleaseGroups_is_nzbs_releaseGroup()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.AllowedReleaseGroups).Returns("2HD");
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.AllowedReleaseGroups).Returns("2HD");
|
||||||
Mocker.Resolve<AllowedReleaseGroupSpecification>().IsSatisfiedBy(parseResult).Should().BeTrue();
|
Mocker.Resolve<AllowedReleaseGroupSpecification>().IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void should_be_true_when_allowedReleaseGroups_contains_nzbs_releaseGroup()
|
public void should_be_true_when_allowedReleaseGroups_contains_nzbs_releaseGroup()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.AllowedReleaseGroups).Returns("2HD, LOL");
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.AllowedReleaseGroups).Returns("2HD, LOL");
|
||||||
Mocker.Resolve<AllowedReleaseGroupSpecification>().IsSatisfiedBy(parseResult).Should().BeTrue();
|
Mocker.Resolve<AllowedReleaseGroupSpecification>().IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void should_be_false_when_allowedReleaseGroups_does_not_contain_nzbs_releaseGroup()
|
public void should_be_false_when_allowedReleaseGroups_does_not_contain_nzbs_releaseGroup()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.AllowedReleaseGroups).Returns("LOL,DTD");
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.AllowedReleaseGroups).Returns("LOL,DTD");
|
||||||
Mocker.Resolve<AllowedReleaseGroupSpecification>().IsSatisfiedBy(parseResult).Should().BeFalse();
|
Mocker.Resolve<AllowedReleaseGroupSpecification>().IsSatisfiedBy(parseResult).Should().BeFalse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,22 +38,22 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||||
|
|
||||||
private void WithUnlimitedRetention()
|
private void WithUnlimitedRetention()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.Retention).Returns(0);
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.Retention).Returns(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WithLongRetention()
|
private void WithLongRetention()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.Retention).Returns(1000);
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.Retention).Returns(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WithShortRetention()
|
private void WithShortRetention()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.Retention).Returns(10);
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.Retention).Returns(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WithEqualRetention()
|
private void WithEqualRetention()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.Retention).Returns(100);
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.Retention).Returns(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -30,17 +30,17 @@ namespace NzbDrone.Core.Test.IndexerTests
|
||||||
{
|
{
|
||||||
private void WithConfiguredIndexers()
|
private void WithConfiguredIndexers()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.NzbsOrgHash).Returns("MockedConfigValue");
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.NzbsOrgHash).Returns("MockedConfigValue");
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.NzbsOrgUId).Returns("MockedConfigValue");
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.NzbsOrgUId).Returns("MockedConfigValue");
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.NzbsrusHash).Returns("MockedConfigValue");
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.NzbsrusHash).Returns("MockedConfigValue");
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.NzbsrusUId).Returns("MockedConfigValue");
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.NzbsrusUId).Returns("MockedConfigValue");
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.FileSharingTalkUid).Returns("MockedConfigValue");
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.FileSharingTalkUid).Returns("MockedConfigValue");
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.FileSharingTalkSecret).Returns("MockedConfigValue");
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.FileSharingTalkSecret).Returns("MockedConfigValue");
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.OmgwtfnzbsUsername).Returns("MockedConfigValue");
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.OmgwtfnzbsUsername).Returns("MockedConfigValue");
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.OmgwtfnzbsApiKey).Returns("MockedConfigValue");
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.OmgwtfnzbsApiKey).Returns("MockedConfigValue");
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase("nzbsrus.xml")]
|
[TestCase("nzbsrus.xml")]
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||||
{
|
{
|
||||||
private void WithEnableBacklogSearching()
|
private void WithEnableBacklogSearching()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.EnableBacklogSearching).Returns(true);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.EnableBacklogSearching).Returns(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||||
Mocker.GetMock<PostDownloadProvider>().Setup(s => s.ProcessDropFolder(path));
|
Mocker.GetMock<PostDownloadProvider>().Setup(s => s.ProcessDropFolder(path));
|
||||||
Mocker.Resolve<PostDownloadScanJob>().Start(MockNotification, new { Path = path });
|
Mocker.Resolve<PostDownloadScanJob>().Start(MockNotification, new { Path = path });
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>().Verify(s => s.DownloadClientTvDirectory, Times.Never());
|
Mocker.GetMock<IConfigService>().Verify(s => s.DownloadClientTvDirectory, Times.Never());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -53,10 +53,10 @@ namespace NzbDrone.Core.Test.JobTests
|
||||||
{
|
{
|
||||||
var path = @"C:\Test\Unsorted TV";
|
var path = @"C:\Test\Unsorted TV";
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.DownloadClientTvDirectory).Returns(path);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.DownloadClientTvDirectory).Returns(path);
|
||||||
Mocker.Resolve<PostDownloadScanJob>().Start(MockNotification, null);
|
Mocker.Resolve<PostDownloadScanJob>().Start(MockNotification, null);
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>().Verify(s => s.DownloadClientTvDirectory, Times.Once());
|
Mocker.GetMock<IConfigService>().Verify(s => s.DownloadClientTvDirectory, Times.Once());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -64,7 +64,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||||
{
|
{
|
||||||
var path = @"C:\Test\Unsorted TV";
|
var path = @"C:\Test\Unsorted TV";
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.DownloadClientTvDirectory).Returns(path);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.DownloadClientTvDirectory).Returns(path);
|
||||||
Mocker.Resolve<PostDownloadScanJob>().Start(MockNotification, null);
|
Mocker.Resolve<PostDownloadScanJob>().Start(MockNotification, null);
|
||||||
|
|
||||||
Mocker.GetMock<PostDownloadProvider>().Verify(s => s.ProcessDropFolder(path), Times.Once());
|
Mocker.GetMock<PostDownloadProvider>().Verify(s => s.ProcessDropFolder(path), Times.Once());
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||||
{
|
{
|
||||||
private void WithEnableBacklogSearching()
|
private void WithEnableBacklogSearching()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.EnableBacklogSearching).Returns(true);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.EnableBacklogSearching).Returns(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||||
{
|
{
|
||||||
public void WithMinutes(int minutes)
|
public void WithMinutes(int minutes)
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.RssSyncInterval).Returns(minutes);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.RssSyncInterval).Returns(minutes);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase(10)]
|
[TestCase(10)]
|
||||||
|
|
|
@ -91,7 +91,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DiskScanProviderTests
|
||||||
Mocker.GetMock<MediaFileProvider>()
|
Mocker.GetMock<MediaFileProvider>()
|
||||||
.Setup(e => e.Delete(It.IsAny<int>()));
|
.Setup(e => e.Delete(It.IsAny<int>()));
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>()
|
Mocker.GetMock<IConfigService>()
|
||||||
.SetupGet(s => s.AutoIgnorePreviouslyDownloadedEpisodes)
|
.SetupGet(s => s.AutoIgnorePreviouslyDownloadedEpisodes)
|
||||||
.Returns(true);
|
.Returns(true);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.BlackholeDirectory).Returns(blackHoleFolder);
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.BlackholeDirectory).Returns(blackHoleFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.NzbgetProviderTes
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
var fakeConfig = Mocker.GetMock<ConfigService>();
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
||||||
fakeConfig.SetupGet(c => c.NzbgetHost).Returns("192.168.5.55");
|
fakeConfig.SetupGet(c => c.NzbgetHost).Returns("192.168.5.55");
|
||||||
fakeConfig.SetupGet(c => c.NzbgetPort).Returns(6789);
|
fakeConfig.SetupGet(c => c.NzbgetPort).Returns(6789);
|
||||||
fakeConfig.SetupGet(c => c.NzbgetUsername).Returns("nzbget");
|
fakeConfig.SetupGet(c => c.NzbgetUsername).Returns("nzbget");
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.NzbgetProviderTes
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
var fakeConfig = Mocker.GetMock<ConfigService>();
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
||||||
fakeConfig.SetupGet(c => c.NzbgetHost).Returns("192.168.5.55");
|
fakeConfig.SetupGet(c => c.NzbgetHost).Returns("192.168.5.55");
|
||||||
fakeConfig.SetupGet(c => c.NzbgetPort).Returns(6789);
|
fakeConfig.SetupGet(c => c.NzbgetPort).Returns(6789);
|
||||||
fakeConfig.SetupGet(c => c.NzbgetUsername).Returns("nzbget");
|
fakeConfig.SetupGet(c => c.NzbgetUsername).Returns("nzbget");
|
||||||
|
|
|
@ -30,8 +30,8 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests
|
||||||
{
|
{
|
||||||
nzbPath = pneumaticFolder + title + ".nzb";
|
nzbPath = pneumaticFolder + title + ".nzb";
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.PneumaticDirectory).Returns(pneumaticFolder);
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.PneumaticDirectory).Returns(pneumaticFolder);
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.DownloadClientTvDirectory).Returns(sabDrop);
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.DownloadClientTvDirectory).Returns(sabDrop);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WithExistingFile()
|
private void WithExistingFile()
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
|
||||||
string password = "pass";
|
string password = "pass";
|
||||||
string cat = "tv";
|
string cat = "tv";
|
||||||
|
|
||||||
var fakeConfig = Mocker.GetMock<ConfigService>();
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
||||||
fakeConfig.SetupGet(c => c.SabHost).Returns(sabHost);
|
fakeConfig.SetupGet(c => c.SabHost).Returns(sabHost);
|
||||||
fakeConfig.SetupGet(c => c.SabPort).Returns(sabPort);
|
fakeConfig.SetupGet(c => c.SabPort).Returns(sabPort);
|
||||||
fakeConfig.SetupGet(c => c.SabApiKey).Returns(apikey);
|
fakeConfig.SetupGet(c => c.SabApiKey).Returns(apikey);
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
var fakeConfig = Mocker.GetMock<ConfigService>();
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
||||||
|
|
||||||
fakeConfig.SetupGet(c => c.SabHost).Returns("192.168.5.55");
|
fakeConfig.SetupGet(c => c.SabHost).Returns("192.168.5.55");
|
||||||
fakeConfig.SetupGet(c => c.SabPort).Returns(2222);
|
fakeConfig.SetupGet(c => c.SabPort).Returns(2222);
|
||||||
|
@ -210,11 +210,11 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
|
||||||
[Test]
|
[Test]
|
||||||
public void downloadNzb_should_use_sabRecentTvPriority_when_recentEpisode_is_true()
|
public void downloadNzb_should_use_sabRecentTvPriority_when_recentEpisode_is_true()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>()
|
Mocker.GetMock<IConfigService>()
|
||||||
.SetupGet(s => s.SabRecentTvPriority)
|
.SetupGet(s => s.SabRecentTvPriority)
|
||||||
.Returns(SabPriorityType.High);
|
.Returns(SabPriorityType.High);
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>()
|
Mocker.GetMock<IConfigService>()
|
||||||
.SetupGet(s => s.SabBacklogTvPriority)
|
.SetupGet(s => s.SabBacklogTvPriority)
|
||||||
.Returns(SabPriorityType.Low);
|
.Returns(SabPriorityType.Low);
|
||||||
|
|
||||||
|
@ -232,11 +232,11 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
|
||||||
[Test]
|
[Test]
|
||||||
public void downloadNzb_should_use_sabBackogTvPriority_when_recentEpisode_is_false()
|
public void downloadNzb_should_use_sabBackogTvPriority_when_recentEpisode_is_false()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>()
|
Mocker.GetMock<IConfigService>()
|
||||||
.SetupGet(s => s.SabRecentTvPriority)
|
.SetupGet(s => s.SabRecentTvPriority)
|
||||||
.Returns(SabPriorityType.High);
|
.Returns(SabPriorityType.High);
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>()
|
Mocker.GetMock<IConfigService>()
|
||||||
.SetupGet(s => s.SabBacklogTvPriority)
|
.SetupGet(s => s.SabBacklogTvPriority)
|
||||||
.Returns(SabPriorityType.Low);
|
.Returns(SabPriorityType.Low);
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadProviderTests
|
||||||
|
|
||||||
private void SetDownloadClient(DownloadClientType clientType)
|
private void SetDownloadClient(DownloadClientType clientType)
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>()
|
Mocker.GetMock<IConfigService>()
|
||||||
.Setup(c => c.DownloadClient)
|
.Setup(c => c.DownloadClient)
|
||||||
.Returns(clientType);
|
.Returns(clientType);
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadProviderTests
|
||||||
.Verify(s => s.DownloadNzb(It.IsAny<String>(), It.IsAny<String>(), true), Times.Never());
|
.Verify(s => s.DownloadNzb(It.IsAny<String>(), It.IsAny<String>(), true), Times.Never());
|
||||||
|
|
||||||
|
|
||||||
VerifyEventPublished(It.Is<EpisodeGrabbedEvent>(c => c.ParseResult == parseResult));
|
VerifyEventPublished<EpisodeGrabbedEvent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase(DownloadClientType.Sabnzbd)]
|
[TestCase(DownloadClientType.Sabnzbd)]
|
||||||
|
|
|
@ -134,7 +134,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>().Setup(e => e.SortingSeasonFolderFormat).Returns(seasonFolderFormat);
|
Mocker.GetMock<IConfigService>().Setup(e => e.SortingSeasonFolderFormat).Returns(seasonFolderFormat);
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
var result = Mocker.Resolve<MediaFileProvider>().CalculateFilePath(fakeSeries, 1, filename, ".mkv");
|
var result = Mocker.Resolve<MediaFileProvider>().CalculateFilePath(fakeSeries, 1, filename, ".mkv");
|
||||||
|
|
|
@ -94,7 +94,7 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
|
||||||
|
|
||||||
private void WithUseBanners()
|
private void WithUseBanners()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.MetadataUseBanners).Returns(true);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.MetadataUseBanners).Returns(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WithSingleEpisodeFile()
|
private void WithSingleEpisodeFile()
|
||||||
|
|
|
@ -76,7 +76,7 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
|
||||||
|
|
||||||
private void WithUseBanners()
|
private void WithUseBanners()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.MetadataUseBanners).Returns(true);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.MetadataUseBanners).Returns(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WithSpecials()
|
private void WithSpecials()
|
||||||
|
|
|
@ -27,22 +27,22 @@ namespace NzbDrone.Core.Test.ProviderTests
|
||||||
{
|
{
|
||||||
private void WithSingleClient()
|
private void WithSingleClient()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.PlexClientHosts)
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.PlexClientHosts)
|
||||||
.Returns("localhost:3000");
|
.Returns("localhost:3000");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WithMultipleClients()
|
private void WithMultipleClients()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.PlexClientHosts)
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.PlexClientHosts)
|
||||||
.Returns("localhost:3000, 192.168.0.10:3000");
|
.Returns("localhost:3000, 192.168.0.10:3000");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WithClientCredentials()
|
public void WithClientCredentials()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.PlexUsername)
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.PlexUsername)
|
||||||
.Returns("plex");
|
.Returns("plex");
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.PlexPassword)
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.PlexPassword)
|
||||||
.Returns("plex");
|
.Returns("plex");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace NzbDrone.Core.Test.ProviderTests.RecycleBinProviderTests
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.RecycleBin).Returns(RecycleBin);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.RecycleBin).Returns(RecycleBin);
|
||||||
|
|
||||||
Mocker.GetMock<DiskProvider>().Setup(s => s.GetDirectories(RecycleBin))
|
Mocker.GetMock<DiskProvider>().Setup(s => s.GetDirectories(RecycleBin))
|
||||||
.Returns(new [] { @"C:\Test\RecycleBin\Folder1", @"C:\Test\RecycleBin\Folder2", @"C:\Test\RecycleBin\Folder3" });
|
.Returns(new [] { @"C:\Test\RecycleBin\Folder1", @"C:\Test\RecycleBin\Folder2", @"C:\Test\RecycleBin\Folder3" });
|
||||||
|
@ -62,7 +62,7 @@ namespace NzbDrone.Core.Test.ProviderTests.RecycleBinProviderTests
|
||||||
[Test]
|
[Test]
|
||||||
public void should_return_if_recycleBin_not_configured()
|
public void should_return_if_recycleBin_not_configured()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.RecycleBin).Returns(String.Empty);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.RecycleBin).Returns(String.Empty);
|
||||||
|
|
||||||
Mocker.Resolve<RecycleBinProvider>().Cleanup();
|
Mocker.Resolve<RecycleBinProvider>().Cleanup();
|
||||||
|
|
||||||
|
|
|
@ -29,12 +29,12 @@ namespace NzbDrone.Core.Test.ProviderTests.RecycleBinProviderTests
|
||||||
{
|
{
|
||||||
private void WithRecycleBin()
|
private void WithRecycleBin()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.RecycleBin).Returns(@"C:\Test\Recycle Bin");
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.RecycleBin).Returns(@"C:\Test\Recycle Bin");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WithoutRecycleBin()
|
private void WithoutRecycleBin()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.RecycleBin).Returns(String.Empty);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.RecycleBin).Returns(String.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -29,12 +29,12 @@ namespace NzbDrone.Core.Test.ProviderTests.RecycleBinProviderTests
|
||||||
{
|
{
|
||||||
private void WithRecycleBin()
|
private void WithRecycleBin()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.RecycleBin).Returns(@"C:\Test\Recycle Bin");
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.RecycleBin).Returns(@"C:\Test\Recycle Bin");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WithoutRecycleBin()
|
private void WithoutRecycleBin()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.RecycleBin).Returns(String.Empty);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.RecycleBin).Returns(String.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace NzbDrone.Core.Test.ProviderTests.RecycleBinProviderTests
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.RecycleBin).Returns(RecycleBin);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.RecycleBin).Returns(RecycleBin);
|
||||||
|
|
||||||
Mocker.GetMock<DiskProvider>().Setup(s => s.GetDirectories(RecycleBin))
|
Mocker.GetMock<DiskProvider>().Setup(s => s.GetDirectories(RecycleBin))
|
||||||
.Returns(new [] { @"C:\Test\RecycleBin\Folder1", @"C:\Test\RecycleBin\Folder2", @"C:\Test\RecycleBin\Folder3" });
|
.Returns(new [] { @"C:\Test\RecycleBin\Folder1", @"C:\Test\RecycleBin\Folder2", @"C:\Test\RecycleBin\Folder3" });
|
||||||
|
@ -44,7 +44,7 @@ namespace NzbDrone.Core.Test.ProviderTests.RecycleBinProviderTests
|
||||||
[Test]
|
[Test]
|
||||||
public void should_return_if_recycleBin_not_configured()
|
public void should_return_if_recycleBin_not_configured()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.RecycleBin).Returns(String.Empty);
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.RecycleBin).Returns(String.Empty);
|
||||||
|
|
||||||
Mocker.Resolve<RecycleBinProvider>().Empty();
|
Mocker.Resolve<RecycleBinProvider>().Empty();
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.ServiceRootUrl)
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.ServiceRootUrl)
|
||||||
.Returns("http://services.nzbdrone.com");
|
.Returns("http://services.nzbdrone.com");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.ServiceRootUrl)
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.ServiceRootUrl)
|
||||||
.Returns("http://services.nzbdrone.com");
|
.Returns("http://services.nzbdrone.com");
|
||||||
|
|
||||||
WithRealDb();
|
WithRealDb();
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace NzbDrone.Core.Test.ProviderTests.UpdateProviderTests
|
||||||
{
|
{
|
||||||
WithStrictMocker();
|
WithStrictMocker();
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.UpdateUrl).Returns("http://update.nzbdrone.com/_test/");
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.UpdateUrl).Returns("http://update.nzbdrone.com/_test/");
|
||||||
Mocker.Resolve<HttpProvider>();
|
Mocker.Resolve<HttpProvider>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -297,7 +297,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
||||||
var header = "NzbDrone Test";
|
var header = "NzbDrone Test";
|
||||||
var message = "Test Message!";
|
var message = "Test Message!";
|
||||||
|
|
||||||
var fakeConfig = Mocker.GetMock<ConfigService>();
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
||||||
fakeConfig.SetupGet(s => s.XbmcHosts).Returns("localhost:8080");
|
fakeConfig.SetupGet(s => s.XbmcHosts).Returns("localhost:8080");
|
||||||
|
|
||||||
//var fakeUdpProvider = Mocker.GetMock<EventClient>();
|
//var fakeUdpProvider = Mocker.GetMock<EventClient>();
|
||||||
|
@ -441,7 +441,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
||||||
//Setup
|
//Setup
|
||||||
WithStrictMocker();
|
WithStrictMocker();
|
||||||
|
|
||||||
var fakeConfig = Mocker.GetMock<ConfigService>();
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
||||||
fakeConfig.SetupGet(s => s.XbmcHosts).Returns("localhost:8080");
|
fakeConfig.SetupGet(s => s.XbmcHosts).Returns("localhost:8080");
|
||||||
|
|
||||||
var fakeEventClient = Mocker.GetMock<EventClientProvider>();
|
var fakeEventClient = Mocker.GetMock<EventClientProvider>();
|
||||||
|
|
|
@ -816,7 +816,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
|
||||||
WithRealDb();
|
WithRealDb();
|
||||||
Mocker.Resolve<TvDbProvider>();
|
Mocker.Resolve<TvDbProvider>();
|
||||||
|
|
||||||
Mocker.GetMock<ConfigService>()
|
Mocker.GetMock<IConfigService>()
|
||||||
.Setup(e => e.DefaultQualityProfile).Returns(1);
|
.Setup(e => e.DefaultQualityProfile).Returns(1);
|
||||||
|
|
||||||
Db.Insert(Builder<QualityProfile>.CreateNew().Build());
|
Db.Insert(Builder<QualityProfile>.CreateNew().Build());
|
||||||
|
|
Binary file not shown.
|
@ -101,9 +101,9 @@ namespace NzbDrone.Test.Common
|
||||||
return Path.Combine(Directory.GetCurrentDirectory(), "Files", fileName);
|
return Path.Combine(Directory.GetCurrentDirectory(), "Files", fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void VerifyEventPublished<TEvent>(TEvent message) where TEvent : IEvent
|
protected void VerifyEventPublished<TEvent>() where TEvent : IEvent
|
||||||
{
|
{
|
||||||
Mocker.GetMock<IEventAggregator>().Verify(c => c.Publish(message), Times.Once());
|
Mocker.GetMock<IEventAggregator>().Verify(c => c.Publish(It.IsAny<TEvent>()), Times.Once());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void VerifyEventNotPublished<TEvent>() where TEvent : IEvent
|
protected void VerifyEventNotPublished<TEvent>() where TEvent : IEvent
|
||||||
|
|
Loading…
Reference in New Issue