Lidarr/src/NzbDrone.Core.Test/IndexerSearchTests/SearchDefinitionFixture.cs

42 lines
1.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Music;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.IndexerSearchTests
{
public class AlbumSearchDefinitionFixture : CoreTest<AlbumSearchCriteria>
{
[TestCase("Mötley Crüe", "Motley+Crue")]
[TestCase("방탄소년단", "방탄소년단")]
public void should_replace_some_special_characters_artist(string artist, string expected)
{
Subject.Artist = new Artist { Name = artist };
Subject.CleanArtistQuery.Should().Be(expected);
}
[TestCase("…and Justice for All", "and+Justice+for+All")]
[TestCase("American III: Solitary Man", "American+III+Solitary+Man")]
[TestCase("Sad Clowns & Hillbillies", "Sad+Clowns+Hillbillies")]
[TestCase("¿Quién sabe?", "Quien+sabe")]
[TestCase("Seal the Deal & Lets Boogie", "Seal+the+Deal+Let's+Boogie")]
[TestCase("Section.80", "Section+80")]
[TestCase("Anthology: Hey Ho, Lets Go!", "Anthology+Hey+Ho+Let's+Go")]
[TestCase("Vankelsteg - Mot Okända Hembygder", "Vankelsteg+Mot+Okanda+Hembygder")]
[TestCase("The Beach Boys - The Beach Boys' Christmas Album", "Beach+Boys+The+Beach+Boys'+Christmas+Album")]
public void should_replace_some_special_characters(string album, string expected)
{
Subject.AlbumTitle = album;
Subject.CleanAlbumQuery.Should().Be(expected);
}
[TestCase("+", "+")]
public void should_not_replace_some_special_characters_if_result_empty_string(string album, string expected)
{
Subject.AlbumTitle = album;
Subject.CleanAlbumQuery.Should().Be(expected);
}
}
}