2013-04-28 22:46:13 +03:00
|
|
|
using FluentAssertions;
|
2013-01-16 04:36:02 +03:00
|
|
|
using NUnit.Framework;
|
2013-03-07 03:19:49 +03:00
|
|
|
using NzbDrone.Core.DecisionEngine.Specifications;
|
2013-04-15 04:41:39 +03:00
|
|
|
using NzbDrone.Core.Parser;
|
|
|
|
using NzbDrone.Core.Parser.Model;
|
2013-01-16 04:36:02 +03:00
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
2013-02-19 05:19:38 +03:00
|
|
|
namespace NzbDrone.Core.Test.DecisionEngineTests
|
2013-01-16 04:36:02 +03:00
|
|
|
{
|
|
|
|
[TestFixture]
|
2013-04-28 22:46:13 +03:00
|
|
|
|
2013-02-17 08:44:06 +03:00
|
|
|
public class LanguageSpecificationFixture : CoreTest
|
2013-01-16 04:36:02 +03:00
|
|
|
{
|
2013-04-15 04:41:39 +03:00
|
|
|
private RemoteEpisode parseResult;
|
2013-01-16 04:36:02 +03:00
|
|
|
|
|
|
|
private void WithEnglishRelease()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
parseResult = new RemoteEpisode
|
|
|
|
{
|
|
|
|
ParsedEpisodeInfo = new ParsedEpisodeInfo
|
|
|
|
{
|
|
|
|
Language = Language.English
|
|
|
|
}
|
|
|
|
};
|
2013-01-16 04:36:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
private void WithGermanRelease()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
parseResult = new RemoteEpisode
|
|
|
|
{
|
|
|
|
ParsedEpisodeInfo = new ParsedEpisodeInfo
|
|
|
|
{
|
|
|
|
Language = Language.German
|
|
|
|
}
|
|
|
|
};
|
2013-01-16 04:36:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void should_return_true_if_language_is_english()
|
|
|
|
{
|
|
|
|
WithEnglishRelease();
|
|
|
|
|
|
|
|
Mocker.Resolve<LanguageSpecification>().IsSatisfiedBy(parseResult).Should().BeTrue();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void should_return_false_if_language_is_german()
|
|
|
|
{
|
|
|
|
WithGermanRelease();
|
|
|
|
|
|
|
|
Mocker.Resolve<LanguageSpecification>().IsSatisfiedBy(parseResult).Should().BeFalse();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|