|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
// ReSharper disable RedundantUsingDirective
|
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using MbUnit.Framework;
|
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
@ -83,5 +84,50 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
//assert
|
|
|
|
|
Assert.IsNull(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void American_dad_fix()
|
|
|
|
|
{
|
|
|
|
|
//setup
|
|
|
|
|
var tvdbProvider = new TvDbProvider();
|
|
|
|
|
|
|
|
|
|
//act
|
|
|
|
|
var result = tvdbProvider.GetSeries(73141, true);
|
|
|
|
|
|
|
|
|
|
var seasons = result.Episodes.Select(e => e.SeasonNumber)
|
|
|
|
|
.Distinct().ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var seasons1 = result.Episodes.Where(e => e.SeasonNumber == 1).ToList();
|
|
|
|
|
var seasons2 = result.Episodes.Where(e => e.SeasonNumber == 2).ToList();
|
|
|
|
|
var seasons3 = result.Episodes.Where(e => e.SeasonNumber == 3).ToList();
|
|
|
|
|
var seasons4 = result.Episodes.Where(e => e.SeasonNumber == 4).ToList();
|
|
|
|
|
var seasons5 = result.Episodes.Where(e => e.SeasonNumber == 5).ToList();
|
|
|
|
|
var seasons6 = result.Episodes.Where(e => e.SeasonNumber == 6).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var episode in result.Episodes)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(episode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//assert
|
|
|
|
|
Assert.Count(7, seasons);
|
|
|
|
|
Assert.Count(23, seasons1);
|
|
|
|
|
Assert.Count(19, seasons2);
|
|
|
|
|
Assert.Count(16, seasons3);
|
|
|
|
|
Assert.Count(20, seasons4);
|
|
|
|
|
Assert.Count(18, seasons5);
|
|
|
|
|
|
|
|
|
|
Assert.Distinct(seasons1.Select(s => s.EpisodeNumber));
|
|
|
|
|
Assert.Distinct(seasons2.Select(s => s.EpisodeNumber));
|
|
|
|
|
Assert.Distinct(seasons3.Select(s => s.EpisodeNumber));
|
|
|
|
|
Assert.Distinct(seasons4.Select(s => s.EpisodeNumber));
|
|
|
|
|
Assert.Distinct(seasons5.Select(s => s.EpisodeNumber));
|
|
|
|
|
Assert.Distinct(seasons6.Select(s => s.EpisodeNumber));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|