1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-23 02:05:27 +02:00
Sonarr/NzbDrone.Core.Test/DecisionEngineTests/LanguageSpecificationFixture.cs

54 lines
1.4 KiB
C#
Raw Normal View History

using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Test.Framework;
2013-02-19 05:19:38 +03:00
namespace NzbDrone.Core.Test.DecisionEngineTests
{
[TestFixture]
public class LanguageSpecificationFixture : CoreTest
{
private RemoteEpisode parseResult;
private void WithEnglishRelease()
{
parseResult = new RemoteEpisode
{
ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Language = Language.English
}
};
}
private void WithGermanRelease()
{
parseResult = new RemoteEpisode
{
ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Language = Language.German
}
};
}
[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();
}
}
}