2013-04-28 20:08:25 +00:00
|
|
|
using System;
|
2011-11-24 07:35:37 +00:00
|
|
|
using System.Linq;
|
2011-06-02 21:06:46 +00:00
|
|
|
using FluentAssertions;
|
|
|
|
using NUnit.Framework;
|
2013-04-15 01:41:39 +00:00
|
|
|
using NzbDrone.Core.Parser;
|
2011-05-19 03:55:35 +00:00
|
|
|
using NzbDrone.Core.Test.Framework;
|
2010-10-24 07:46:58 +00:00
|
|
|
|
2013-01-01 03:45:57 +00:00
|
|
|
namespace NzbDrone.Core.Test.ParserTests
|
2010-10-24 07:46:58 +00:00
|
|
|
{
|
2013-04-07 19:01:24 +00:00
|
|
|
|
2012-11-26 07:13:55 +00:00
|
|
|
[TestFixture]
|
2013-02-17 05:44:06 +00:00
|
|
|
public class ParserFixture : CoreTest
|
2010-10-24 07:46:58 +00:00
|
|
|
{
|
2011-04-05 06:33:24 +00:00
|
|
|
/*Fucked-up hall of shame,
|
|
|
|
* WWE.Wrestlemania.27.PPV.HDTV.XviD-KYR
|
2011-04-22 22:23:29 +00:00
|
|
|
* Unreported.World.Chinas.Lost.Sons.WS.PDTV.XviD-FTP
|
2011-09-07 06:43:10 +00:00
|
|
|
* [TestCase("Big Time Rush 1x01 to 10 480i DD2 0 Sianto", "Big Time Rush", 1, new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, 10)]
|
2013-01-01 03:45:57 +00:00
|
|
|
* [TestCase("Desparate Housewives - S07E22 - 7x23 - And Lots of Security.. [HDTV-720p].mkv", "Desparate Housewives", 7, new[] { 22, 23 }, 2)]
|
|
|
|
* [TestCase("S07E22 - 7x23 - And Lots of Security.. [HDTV-720p].mkv", "", 7, new[] { 22, 23 }, 2)]
|
2013-06-19 15:44:41 +00:00
|
|
|
* (Game of Thrones s03 e - "Game of Thrones Season 3 Episode 10"
|
2013-11-01 06:15:15 +00:00
|
|
|
* The.Man.of.Steel.1994-05.33.hybrid.DreamGirl-Novus-HD
|
|
|
|
* Superman.-.The.Man.of.Steel.1994-06.34.hybrid.DreamGirl-Novus-HD
|
|
|
|
* Superman.-.The.Man.of.Steel.1994-05.33.hybrid.DreamGirl-Novus-HD
|
2011-04-05 06:33:24 +00:00
|
|
|
*/
|
|
|
|
|
2011-06-23 00:19:19 +00:00
|
|
|
[TestCase("Chuck - 4x05 - Title", "Chuck")]
|
|
|
|
[TestCase("Law & Order - 4x05 - Title", "laworder")]
|
2011-12-10 18:54:16 +00:00
|
|
|
[TestCase("Bad Format", "badformat")]
|
2011-11-18 08:10:30 +00:00
|
|
|
[TestCase("Mad Men - Season 1 [Bluray720p]", "madmen")]
|
|
|
|
[TestCase("Mad Men - Season 1 [Bluray1080p]", "madmen")]
|
2011-12-10 18:54:16 +00:00
|
|
|
[TestCase("The Daily Show With Jon Stewart -", "dailyshowwithjonstewart")]
|
2012-01-12 16:41:58 +00:00
|
|
|
[TestCase("The Venture Bros. (2004)", "venturebros2004")]
|
|
|
|
[TestCase("Castle (2011)", "castle2011")]
|
2012-11-26 07:13:55 +00:00
|
|
|
[TestCase("Adventure Time S02 720p HDTV x264 CRON", "adventuretime")]
|
2014-01-30 06:43:23 +00:00
|
|
|
[TestCase("Hawaii Five 0", "hawaiifive0")]
|
|
|
|
[TestCase("Match of the Day", "matchday")]
|
|
|
|
[TestCase("Match of the Day 2", "matchday2")]
|
2014-02-20 16:29:41 +00:00
|
|
|
public void should_parse_series_name(string postTitle, string title)
|
2011-06-23 00:19:19 +00:00
|
|
|
{
|
2013-04-15 01:41:39 +00:00
|
|
|
var result = Parser.Parser.ParseSeriesName(postTitle);
|
2013-06-28 00:04:52 +00:00
|
|
|
result.Should().Be(title.CleanSeriesTitle());
|
2011-06-23 00:19:19 +00:00
|
|
|
}
|
2010-10-24 07:46:58 +00:00
|
|
|
}
|
2011-10-25 06:22:34 +00:00
|
|
|
}
|