2012-02-22 07:43:19 +03:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using FluentAssertions;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NzbDrone.Core.Model;
|
|
|
|
using NzbDrone.Core.Repository.Quality;
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test
|
|
|
|
{
|
|
|
|
[TestFixture]
|
|
|
|
// ReSharper disable InconsistentNaming
|
2013-02-17 08:44:06 +03:00
|
|
|
public class EpisodeParseResultTest : CoreTest
|
2012-02-22 07:43:19 +03:00
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void tostring_single_season_episode()
|
|
|
|
{
|
|
|
|
var parseResult = new EpisodeParseResult();
|
|
|
|
parseResult.SeriesTitle = "My Series";
|
|
|
|
parseResult.SeasonNumber = 12;
|
|
|
|
parseResult.EpisodeNumbers = new List<int> { 3 };
|
|
|
|
parseResult.FullSeason = false;
|
|
|
|
parseResult.AirDate = null;
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, false);
|
2012-02-22 07:43:19 +03:00
|
|
|
|
|
|
|
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.ToString().Should().Be("My Series - S12E03 HDTV-720p");
|
2012-02-22 07:43:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void tostring_single_season_episode_proper()
|
|
|
|
{
|
|
|
|
var parseResult = new EpisodeParseResult();
|
|
|
|
parseResult.SeriesTitle = "My Series";
|
|
|
|
parseResult.SeasonNumber = 12;
|
|
|
|
parseResult.EpisodeNumbers = new List<int> { 3 };
|
|
|
|
parseResult.FullSeason = false;
|
|
|
|
parseResult.AirDate = null;
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, true);
|
2012-02-22 07:43:19 +03:00
|
|
|
|
|
|
|
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.ToString().Should().Be("My Series - S12E03 HDTV-720p [proper]");
|
2012-02-22 07:43:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void tostring_multi_season_episode()
|
|
|
|
{
|
|
|
|
var parseResult = new EpisodeParseResult();
|
|
|
|
parseResult.SeriesTitle = "My Series";
|
|
|
|
parseResult.SeasonNumber = 12;
|
|
|
|
parseResult.EpisodeNumbers = new List<int> { 3, 4, 5 };
|
|
|
|
parseResult.FullSeason = false;
|
|
|
|
parseResult.AirDate = null;
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, false);
|
2012-02-22 07:43:19 +03:00
|
|
|
|
|
|
|
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.ToString().Should().Be("My Series - S12E03-04-05 HDTV-720p");
|
2012-02-22 07:43:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void tostring_multi_season_episode_proper()
|
|
|
|
{
|
|
|
|
var parseResult = new EpisodeParseResult();
|
|
|
|
parseResult.SeriesTitle = "My Series";
|
|
|
|
parseResult.SeasonNumber = 12;
|
|
|
|
parseResult.EpisodeNumbers = new List<int> { 3, 4, 5 };
|
|
|
|
parseResult.FullSeason = false;
|
|
|
|
parseResult.AirDate = null;
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, true);
|
2012-02-22 07:43:19 +03:00
|
|
|
|
|
|
|
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.ToString().Should().Be("My Series - S12E03-04-05 HDTV-720p [proper]");
|
2012-02-22 07:43:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void tostring_full_season()
|
|
|
|
{
|
|
|
|
var parseResult = new EpisodeParseResult();
|
|
|
|
parseResult.SeriesTitle = "My Series";
|
|
|
|
parseResult.SeasonNumber = 12;
|
|
|
|
parseResult.FullSeason = true;
|
|
|
|
parseResult.AirDate = null;
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, false);
|
2012-02-22 07:43:19 +03:00
|
|
|
|
|
|
|
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.ToString().Should().Be("My Series - Season 12 HDTV-720p");
|
2012-02-22 07:43:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void tostring_full_season_proper()
|
|
|
|
{
|
|
|
|
var parseResult = new EpisodeParseResult();
|
|
|
|
parseResult.SeriesTitle = "My Series";
|
|
|
|
parseResult.SeasonNumber = 12;
|
|
|
|
parseResult.FullSeason = true;
|
|
|
|
parseResult.AirDate = null;
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, true);
|
2012-02-22 07:43:19 +03:00
|
|
|
|
|
|
|
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.ToString().Should().Be("My Series - Season 12 HDTV-720p [proper]");
|
2012-02-22 07:43:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void tostring_daily_show()
|
|
|
|
{
|
|
|
|
var parseResult = new EpisodeParseResult();
|
|
|
|
parseResult.SeriesTitle = "My Series";
|
|
|
|
parseResult.SeasonNumber = 12;
|
|
|
|
parseResult.FullSeason = true;
|
|
|
|
parseResult.AirDate = new DateTime(2010, 12, 30);
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, false);
|
2012-02-22 07:43:19 +03:00
|
|
|
|
|
|
|
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.ToString().Should().Be("My Series - 2010-12-30 HDTV-720p");
|
2012-02-22 07:43:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void tostring_daily_show_proper()
|
|
|
|
{
|
|
|
|
var parseResult = new EpisodeParseResult();
|
|
|
|
parseResult.SeriesTitle = "My Series";
|
|
|
|
parseResult.SeasonNumber = 12;
|
|
|
|
parseResult.FullSeason = true;
|
|
|
|
parseResult.AirDate = new DateTime(2010, 12, 30);
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, true);
|
2012-02-22 07:43:19 +03:00
|
|
|
|
|
|
|
|
2013-01-01 06:45:57 +03:00
|
|
|
parseResult.ToString().Should().Be("My Series - 2010-12-30 HDTV-720p [proper]");
|
2012-02-22 07:43:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|