mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
cleaned up parsing logic and structure.
This commit is contained in:
parent
cd2761d07d
commit
6e88f55a54
120 changed files with 2149 additions and 3064 deletions
|
@ -1,38 +1,28 @@
|
|||
|
||||
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.DecisionEngine;
|
||||
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
{
|
||||
[TestFixture]
|
||||
|
||||
public class RetentionSpecificationFixture : CoreTest
|
||||
{
|
||||
private RetentionSpecification retentionSpecification;
|
||||
|
||||
private IndexerParseResult parseResult;
|
||||
public class RetentionSpecificationFixture : CoreTest<RetentionSpecification>
|
||||
{
|
||||
|
||||
private RemoteEpisode parseResult;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
retentionSpecification = Mocker.Resolve<RetentionSpecification>();
|
||||
|
||||
parseResult = new IndexerParseResult
|
||||
parseResult = new RemoteEpisode
|
||||
{
|
||||
Age = 100
|
||||
Report = new ReportInfo
|
||||
{
|
||||
Age = 100
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -60,35 +50,35 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
|||
public void unlimited_retention_should_return_true()
|
||||
{
|
||||
WithUnlimitedRetention();
|
||||
retentionSpecification.IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||
Subject.IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void longer_retention_should_return_true()
|
||||
{
|
||||
WithLongRetention();
|
||||
retentionSpecification.IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||
Subject.IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void equal_retention_should_return_true()
|
||||
{
|
||||
WithEqualRetention();
|
||||
retentionSpecification.IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||
Subject.IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void shorter_retention_should_return_false()
|
||||
{
|
||||
WithShortRetention();
|
||||
retentionSpecification.IsSatisfiedBy(parseResult).Should().BeFalse();
|
||||
Subject.IsSatisfiedBy(parseResult).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void zeroDay_report_should_return_true()
|
||||
{
|
||||
WithUnlimitedRetention();
|
||||
retentionSpecification.IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||
Subject.IsSatisfiedBy(parseResult).Should().BeTrue();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue