2017-10-19 01:42:57 +00:00
|
|
|
using FluentAssertions;
|
2013-10-31 23:50:39 +00:00
|
|
|
using NUnit.Framework;
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
{
|
|
|
|
[TestFixture]
|
2017-10-19 01:42:57 +00:00
|
|
|
public class ArtistTitleInfoFixture : CoreTest
|
2013-10-31 23:50:39 +00:00
|
|
|
{
|
2017-12-30 06:09:10 +00:00
|
|
|
|
|
|
|
// TODO: Redo this test and parsed info for Albums which do have a year association
|
2013-10-31 23:50:39 +00:00
|
|
|
[Test]
|
2017-12-30 06:09:10 +00:00
|
|
|
[Ignore("Artist Don't have year association thus we dont use this currently")]
|
2013-10-31 23:50:39 +00:00
|
|
|
public void should_have_year_zero_when_title_doesnt_have_a_year()
|
|
|
|
{
|
2017-12-30 06:09:10 +00:00
|
|
|
const string title = "Alien Ant Farm - TruAnt [Flac]";
|
2013-10-31 23:50:39 +00:00
|
|
|
|
2017-10-19 01:42:57 +00:00
|
|
|
var result = Parser.Parser.ParseAlbumTitle(title).ArtistTitleInfo;
|
2013-10-31 23:50:39 +00:00
|
|
|
|
|
|
|
result.Year.Should().Be(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
2017-12-30 06:09:10 +00:00
|
|
|
[Ignore("Artist Don't have year association thus we dont use this currently")]
|
2013-10-31 23:50:39 +00:00
|
|
|
public void should_have_same_title_for_title_and_title_without_year_when_title_doesnt_have_a_year()
|
|
|
|
{
|
2017-12-30 06:09:10 +00:00
|
|
|
const string title = "Alien Ant Farm - TruAnt [Flac]";
|
2013-10-31 23:50:39 +00:00
|
|
|
|
2017-10-19 01:42:57 +00:00
|
|
|
var result = Parser.Parser.ParseAlbumTitle(title).ArtistTitleInfo;
|
2013-10-31 23:50:39 +00:00
|
|
|
|
|
|
|
result.Title.Should().Be(result.TitleWithoutYear);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
2017-12-30 06:09:10 +00:00
|
|
|
[Ignore("Artist Don't have year association thus we dont use this currently")]
|
2013-10-31 23:50:39 +00:00
|
|
|
public void should_have_year_when_title_has_a_year()
|
|
|
|
{
|
2017-12-30 06:09:10 +00:00
|
|
|
const string title = "Alien Ant Farm - TruAnt [Flac]";
|
2013-10-31 23:50:39 +00:00
|
|
|
|
2017-10-19 01:42:57 +00:00
|
|
|
var result = Parser.Parser.ParseAlbumTitle(title).ArtistTitleInfo;
|
2013-10-31 23:50:39 +00:00
|
|
|
|
|
|
|
result.Year.Should().Be(2004);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
2017-12-24 06:22:48 +00:00
|
|
|
[Ignore("Artist Don't have year association thus we dont use this currently")]
|
2013-10-31 23:50:39 +00:00
|
|
|
public void should_have_year_in_title_when_title_has_a_year()
|
|
|
|
{
|
2017-12-30 06:09:10 +00:00
|
|
|
const string title = "Alien Ant Farm - TruAnt [Flac]";
|
2013-10-31 23:50:39 +00:00
|
|
|
|
2017-10-19 01:42:57 +00:00
|
|
|
var result = Parser.Parser.ParseAlbumTitle(title).ArtistTitleInfo;
|
2013-10-31 23:50:39 +00:00
|
|
|
|
2015-07-06 19:27:23 +00:00
|
|
|
result.Title.Should().Be("House 2004");
|
2013-10-31 23:50:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
2017-12-24 06:22:48 +00:00
|
|
|
[Ignore("Artist Don't have year association thus we dont use this currently")]
|
2013-10-31 23:50:39 +00:00
|
|
|
public void should_title_without_year_should_not_contain_year()
|
|
|
|
{
|
2017-12-30 06:09:10 +00:00
|
|
|
const string title = "Alien Ant Farm - TruAnt [Flac]";
|
2013-10-31 23:50:39 +00:00
|
|
|
|
2017-10-19 01:42:57 +00:00
|
|
|
var result = Parser.Parser.ParseAlbumTitle(title).ArtistTitleInfo;
|
2013-10-31 23:50:39 +00:00
|
|
|
|
2015-07-06 19:27:23 +00:00
|
|
|
result.TitleWithoutYear.Should().Be("House");
|
2013-10-31 23:50:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|