You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readarr/src/NzbDrone.Core.Test/IndexerSearchTests/SearchDefinitionFixture.cs

41 lines
1.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Books;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.IndexerSearchTests
{
public class BookSearchDefinitionFixture : CoreTest<BookSearchCriteria>
{
[TestCase("Mötley Crüe", "Motley+Crue")]
[TestCase("방탄소년단", "방탄소년단")]
public void should_replace_some_special_characters_author(string author, string expected)
{
Subject.Author = new Author { Name = author };
Subject.CleanAuthorQuery.Should().Be(expected);
}
[TestCase("…and Justice for All", "and+Justice+for+All")]
[TestCase("American III: Solitary Man", "American+III")]
[TestCase("Sad Clowns & Hillbillies", "Sad+Clowns+Hillbillies")]
[TestCase("¿Quién sabe?", "Quien+sabe")]
[TestCase("Seal the Deal & Lets Boogie", "Seal+the+Deal+Lets+Boogie")]
[TestCase("Section.80", "Section+80")]
public void should_replace_some_special_characters(string book, string expected)
{
Subject.Author = new Author { Name = "Author" };
Subject.BookTitle = book;
Subject.CleanBookQuery.Should().Be(expected);
}
[TestCase("+", "+")]
public void should_not_replace_some_special_characters_if_result_empty_string(string book, string expected)
{
Subject.Author = new Author { Name = "Author" };
Subject.BookTitle = book;
Subject.CleanBookQuery.Should().Be(expected);
}
}
}