cleaned up parsing logic and structure.

This commit is contained in:
kay.one 2013-04-14 18:41:39 -07:00
commit 6e88f55a54
120 changed files with 2149 additions and 3064 deletions

View file

@ -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();
}
}
}