mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-27 22:56:45 -04:00
Fixed: Improved title sorting for 'A to Z'
This commit is contained in:
@@ -85,7 +85,7 @@ namespace NzbDrone.Core.Test.MetadataSourceTests
|
||||
series.Should().NotBeNull();
|
||||
series.Title.Should().NotBeNullOrWhiteSpace();
|
||||
series.CleanTitle.Should().Be(Parser.Parser.CleanSeriesTitle(series.Title));
|
||||
series.SortTitle.Should().Be(Parser.Parser.NormalizeEpisodeTitle(series.Title));
|
||||
series.SortTitle.Should().Be(SeriesTitleNormalizer.Normalize(series.Title, series.TvdbId));
|
||||
series.Overview.Should().NotBeNullOrWhiteSpace();
|
||||
series.AirTime.Should().NotBeNullOrWhiteSpace();
|
||||
series.FirstAired.Should().HaveValue();
|
||||
|
||||
@@ -292,6 +292,7 @@
|
||||
<Compile Include="TvTests\SeriesServiceTests\AddSeriesFixture.cs" />
|
||||
<Compile Include="TvTests\SeriesServiceTests\UpdateMultipleSeriesFixture.cs" />
|
||||
<Compile Include="TvTests\SeriesServiceTests\UpdateSeriesFixture.cs" />
|
||||
<Compile Include="TvTests\SeriesTitleNormalizerFixture.cs" />
|
||||
<Compile Include="TvTests\ShouldRefreshSeriesFixture.cs" />
|
||||
<Compile Include="UpdateTests\UpdatePackageProviderFixture.cs" />
|
||||
<Compile Include="UpdateTests\UpdateServiceFixture.cs" />
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
||||
namespace NzbDrone.Core.Test.TvTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class SeriesTitleNormalizerFixture
|
||||
{
|
||||
[Test]
|
||||
public void should_use_precomputed_title_for_a_to_z()
|
||||
{
|
||||
SeriesTitleNormalizer.Normalize("A to Z", 281588).Should().Be("a to z");
|
||||
}
|
||||
|
||||
[TestCase("2 Broke Girls", "2 broke girls")]
|
||||
[TestCase("Archer (2009)", "archer 2009")]
|
||||
[TestCase("The Office (US)", "office us")]
|
||||
[TestCase("The Mentalist", "mentalist")]
|
||||
[TestCase("The Good Wife", "good wife")]
|
||||
[TestCase("The Newsroom (2012)", "newsroom 2012")]
|
||||
public void should_normalize_title(String title, String expected)
|
||||
{
|
||||
SeriesTitleNormalizer.Normalize(title, 0).Should().Be(expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user