mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-26 22:46:37 -04:00
cleaned up parsing logic and structure.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user