mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-26 22:46:37 -04:00
Added name + year lookups
New: Support series lookup when year has been appended to the release name
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.ParserTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class SeriesTitleInfoFixture : CoreTest
|
||||
{
|
||||
[Test]
|
||||
public void should_have_year_zero_when_title_doesnt_have_a_year()
|
||||
{
|
||||
const string title = "House.S01E01.pilot.720p.hdtv";
|
||||
|
||||
var result = Parser.Parser.ParseTitle(title).SeriesTitleInfo;
|
||||
|
||||
result.Year.Should().Be(0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_have_same_title_for_title_and_title_without_year_when_title_doesnt_have_a_year()
|
||||
{
|
||||
const string title = "House.S01E01.pilot.720p.hdtv";
|
||||
|
||||
var result = Parser.Parser.ParseTitle(title).SeriesTitleInfo;
|
||||
|
||||
result.Title.Should().Be(result.TitleWithoutYear);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_have_year_when_title_has_a_year()
|
||||
{
|
||||
const string title = "House.2004.S01E01.pilot.720p.hdtv";
|
||||
|
||||
var result = Parser.Parser.ParseTitle(title).SeriesTitleInfo;
|
||||
|
||||
result.Year.Should().Be(2004);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_have_year_in_title_when_title_has_a_year()
|
||||
{
|
||||
const string title = "House.2004.S01E01.pilot.720p.hdtv";
|
||||
|
||||
var result = Parser.Parser.ParseTitle(title).SeriesTitleInfo;
|
||||
|
||||
result.Title.Should().Be("house2004");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_title_without_year_should_not_contain_year()
|
||||
{
|
||||
const string title = "House.2004.S01E01.pilot.720p.hdtv";
|
||||
|
||||
var result = Parser.Parser.ParseTitle(title).SeriesTitleInfo;
|
||||
|
||||
result.TitleWithoutYear.Should().Be("house");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user