mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
moved config to objectdb.
This commit is contained in:
@@ -7,6 +7,7 @@ using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Tv;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Providers;
|
||||
@@ -42,28 +43,28 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_be_true_when_allowedReleaseGroups_is_empty()
|
||||
{
|
||||
Mocker.GetMock<ConfigProvider>().SetupGet(s => s.AllowedReleaseGroups).Returns(String.Empty);
|
||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.AllowedReleaseGroups).Returns(String.Empty);
|
||||
Mocker.Resolve<AllowedReleaseGroupSpecification>().IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_true_when_allowedReleaseGroups_is_nzbs_releaseGroup()
|
||||
{
|
||||
Mocker.GetMock<ConfigProvider>().SetupGet(s => s.AllowedReleaseGroups).Returns("2HD");
|
||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.AllowedReleaseGroups).Returns("2HD");
|
||||
Mocker.Resolve<AllowedReleaseGroupSpecification>().IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_true_when_allowedReleaseGroups_contains_nzbs_releaseGroup()
|
||||
{
|
||||
Mocker.GetMock<ConfigProvider>().SetupGet(s => s.AllowedReleaseGroups).Returns("2HD, LOL");
|
||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.AllowedReleaseGroups).Returns("2HD, LOL");
|
||||
Mocker.Resolve<AllowedReleaseGroupSpecification>().IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_false_when_allowedReleaseGroups_does_not_contain_nzbs_releaseGroup()
|
||||
{
|
||||
Mocker.GetMock<ConfigProvider>().SetupGet(s => s.AllowedReleaseGroups).Returns("LOL,DTD");
|
||||
Mocker.GetMock<ConfigService>().SetupGet(s => s.AllowedReleaseGroups).Returns("LOL,DTD");
|
||||
Mocker.Resolve<AllowedReleaseGroupSpecification>().IsSatisfiedBy(parseResult).Should().BeFalse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Providers.Core;
|
||||
@@ -37,22 +38,22 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
private void WithUnlimitedRetention()
|
||||
{
|
||||
Mocker.GetMock<ConfigProvider>().SetupGet(c => c.Retention).Returns(0);
|
||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.Retention).Returns(0);
|
||||
}
|
||||
|
||||
private void WithLongRetention()
|
||||
{
|
||||
Mocker.GetMock<ConfigProvider>().SetupGet(c => c.Retention).Returns(1000);
|
||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.Retention).Returns(1000);
|
||||
}
|
||||
|
||||
private void WithShortRetention()
|
||||
{
|
||||
Mocker.GetMock<ConfigProvider>().SetupGet(c => c.Retention).Returns(10);
|
||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.Retention).Returns(10);
|
||||
}
|
||||
|
||||
private void WithEqualRetention()
|
||||
{
|
||||
Mocker.GetMock<ConfigProvider>().SetupGet(c => c.Retention).Returns(100);
|
||||
Mocker.GetMock<ConfigService>().SetupGet(c => c.Retention).Returns(100);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in New Issue
Block a user