mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
Fix tests in CleanFilenameFixture
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
using FluentAssertions;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using NzbDrone.Core.Organizer;
|
||||||
|
using NzbDrone.Core.Test.Framework;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Test.OrganizerTests
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class CleanFilenameFixture : CoreTest
|
||||||
|
{
|
||||||
|
[TestCase("Law & Order: Criminal Intent - S10E07 - Icarus [HDTV-720p]", "Law & Order - Criminal Intent - S10E07 - Icarus [HDTV-720p]")]
|
||||||
|
public void should_replaace_invalid_characters(string name, string expectedName)
|
||||||
|
{
|
||||||
|
FileNameBuilder.CleanFileName(name).Should().Be(expectedName);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase(".hack s01e01", "hack s01e01")]
|
||||||
|
public void should_remove_periods_from_start(string name, string expectedName)
|
||||||
|
{
|
||||||
|
FileNameBuilder.CleanFileName(name).Should().Be(expectedName);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase(" Series Title - S01E01 - Episode Title", "Series Title - S01E01 - Episode Title")]
|
||||||
|
[TestCase("Series Title - S01E01 - Episode Title ", "Series Title - S01E01 - Episode Title")]
|
||||||
|
public void should_remove_spaces_from_start_and_end(string name, string expectedName)
|
||||||
|
{
|
||||||
|
FileNameBuilder.CleanFileName(name).Should().Be(expectedName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using FluentAssertions;
|
|
||||||
using NUnit.Framework;
|
|
||||||
using NzbDrone.Core.Organizer;
|
|
||||||
using NzbDrone.Core.Test.Framework;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Test.OrganizerTests
|
|
||||||
{
|
|
||||||
[TestFixture]
|
|
||||||
public class CleanFixture : CoreTest
|
|
||||||
{
|
|
||||||
[TestCase("Law & Order: Criminal Intent - S10E07 - Icarus [HDTV-720p]",
|
|
||||||
"Law & Order- Criminal Intent - S10E07 - Icarus [HDTV-720p]")]
|
|
||||||
public void CleanFileName(string name, string expectedName)
|
|
||||||
{
|
|
||||||
FileNameBuilder.CleanFileName(name).Should().Be(expectedName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -80,9 +80,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
|
|||||||
[TestCase("The Sixth Sense 2 (Thai)", "Sixth Sense 2, The (Thai)")]
|
[TestCase("The Sixth Sense 2 (Thai)", "Sixth Sense 2, The (Thai)")]
|
||||||
[TestCase("The Amazing Race (Latin America)", "Amazing Race, The (Latin America)")]
|
[TestCase("The Amazing Race (Latin America)", "Amazing Race, The (Latin America)")]
|
||||||
[TestCase("The Rat Pack (A&E)", "Rat Pack, The (A&E)")]
|
[TestCase("The Rat Pack (A&E)", "Rat Pack, The (A&E)")]
|
||||||
[TestCase("The Climax: I (Almost) Got Away With It (2016)", "Climax- I (Almost) Got Away With It, The (2016)")]
|
[TestCase("The Climax: I (Almost) Got Away With It (2016)", "Climax - I (Almost) Got Away With It, The (2016)")]
|
||||||
|
|
||||||
//[TestCase("", "")]
|
|
||||||
public void should_get_expected_title_back(string name, string expected)
|
public void should_get_expected_title_back(string name, string expected)
|
||||||
{
|
{
|
||||||
_author.Name = name;
|
_author.Name = name;
|
||||||
|
|||||||
Reference in New Issue
Block a user