1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-18 23:48:35 +02:00
Sonarr/src/NzbDrone.Core.Test/Providers/XemProxyFixture.cs

74 lines
1.9 KiB
C#
Raw Normal View History

2013-09-17 09:14:47 +03:00
using System;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
2013-09-19 04:09:26 +03:00
using NzbDrone.Core.DataAugmentation.Xem;
2013-09-17 09:14:47 +03:00
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()
{
var ids = Subject.GetXemSeriesIds();
ids.Should().NotBeEmpty();
ids.Should().Contain(i => i == 73141);
2013-09-17 09:14:47 +03:00
}
[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();
}
}
2013-12-01 03:03:15 +03:00
[TestCase(12345, Description = "invalid id")]
[TestCase(267440, Description = "no single connection")]
public void should_return_empty_when_known_error(int id)
2013-09-17 09:14:47 +03:00
{
2013-12-01 03:03:15 +03:00
Subject.GetSceneTvdbMappings(id).Should().BeEmpty();
2013-09-17 09:14:47 +03:00
}
[TestCase(82807)]
[TestCase(73141, Description = "American Dad!")]
public void should_get_mapping(int seriesId)
2013-09-17 09:14:47 +03:00
{
var result = Subject.GetSceneTvdbMappings(seriesId);
2013-09-17 09:14:47 +03:00
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);
}
2013-09-17 09:14:47 +03:00
}
}