You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sonarr/src/NzbDrone.Core.Test/Providers/XemProxyFixture.cs

68 lines
1.7 KiB

11 years ago
using System;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.DataAugmentation.Xem;
11 years ago
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common.Categories;
namespace NzbDrone.Core.Test.Providers
{
[TestFixture]
[IntegrationTest]
public class XemProxyFixture : CoreTest<XemProxy>
{
[SetUp]
public void Setup()
{
UseRealHttp();
}
[Test]
public void get_series_ids()
{
Subject.GetXemSeriesIds().Should().NotBeEmpty();
}
[Test]
[Ignore("XEM's data is not clean")]
public void get_mapping_for_all_series()
{
var ids = Subject.GetXemSeriesIds();
var randomIds = ids.OrderBy(x => Guid.NewGuid()).Take(5);
foreach (var randomId in randomIds)
{
Subject.GetSceneTvdbMappings(randomId).Should().NotBeEmpty();
}
}
[Test]
11 years ago
public void should_return_empty_when_series_is_not_found()
11 years ago
{
11 years ago
Subject.GetSceneTvdbMappings(12345).Should().BeEmpty();
11 years ago
}
[TestCase(82807)]
public void should_get_mapping(int seriesId)
11 years ago
{
var result = Subject.GetSceneTvdbMappings(seriesId);
11 years ago
result.Should().NotBeEmpty();
result.Should().OnlyContain(c => c.Scene != null);
result.Should().OnlyContain(c => c.Tvdb != null);
}
[TestCase(78916)]
public void should_filter_out_episodes_without_scene_mapping(int seriesId)
{
var result = Subject.GetSceneTvdbMappings(seriesId);
result.Should().NotContain(c => c.Tvdb == null);
}
11 years ago
}
}