1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-01 00:12:30 +01:00
Sonarr/NzbDrone.Core.Test/DecisionEngineTests/LanguageSpecificationFixture.cs

57 lines
1.5 KiB
C#
Raw Normal View History

2013-03-28 23:07:09 +01:00

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.Providers;
2013-02-19 03:19:38 +01:00
using NzbDrone.Core.DecisionEngine;
2013-03-07 02:51:47 +01:00
using NzbDrone.Core.Test.Framework;
2013-02-19 03:19:38 +01:00
namespace NzbDrone.Core.Test.DecisionEngineTests
{
[TestFixture]
2013-03-28 23:07:09 +01:00
public class LanguageSpecificationFixture : CoreTest
{
private IndexerParseResult parseResult;
private void WithEnglishRelease()
{
parseResult = Builder<IndexerParseResult>
.CreateNew()
.With(p => p.Language = LanguageType.English)
.Build();
}
private void WithGermanRelease()
{
parseResult = Builder<IndexerParseResult>
.CreateNew()
.With(p => p.Language = LanguageType.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();
}
}
}