1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-06 02:52:41 +01:00
Radarr/NzbDrone.Core.Test/DecisionEngineTests/LanguageSpecificationFixture.cs
2013-04-14 18:41:39 -07:00

59 lines
1.5 KiB
C#

using System.Linq;
using System;
using System.Collections.Generic;
using FizzWare.NBuilder;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.Model;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Providers;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.DecisionEngineTests
{
[TestFixture]
public class LanguageSpecificationFixture : CoreTest
{
private RemoteEpisode parseResult;
private void WithEnglishRelease()
{
parseResult = Builder<RemoteEpisode>
.CreateNew()
.With(p => p.Language = Language.English)
.Build();
}
private void WithGermanRelease()
{
parseResult = Builder<RemoteEpisode>
.CreateNew()
.With(p => p.Language = Language.German)
.Build();
}
[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();
}
}
}