1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-29 19:35:25 +00:00

Some more test cases for CleanTitle

This commit is contained in:
Mark McDowall 2014-12-23 16:37:21 -08:00
parent 5f8af9f3a2
commit 2a2330548c
2 changed files with 6 additions and 2 deletions

View file

@ -61,7 +61,11 @@ public void Setup()
[TestCase("Marvel's Agents of S.H.I.E.L.D.", "Marvels Agents of S.H.I.E.L.D")]
[TestCase("Castle (2009)", "Castle 2009")]
[TestCase("Law & Order (UK)", "Law and Order UK")]
// [TestCase("", "")]
[TestCase("Is this okay?", "Is this okay")]
[TestCase("[a] title", "a title")]
[TestCase("backslash \\ backlash", "backslash backlash")]
//[TestCase("", "")]
//[TestCase("", "")]
public void should_get_expected_title_back(string title, string expected)
{
_series.Title = title;

View file

@ -56,7 +56,7 @@ public class FileNameBuilder : IBuildFileNames
private static readonly Regex FileNameCleanupRegex = new Regex(@"([- ._])(\1)+", RegexOptions.Compiled);
private static readonly Regex TrimSeparatorsRegex = new Regex(@"[- ._]$", RegexOptions.Compiled);
private static readonly Regex ScenifyRemoveChars = new Regex(@"(?<=\s)(,|<|>|\/|\\|;|:|'|""|\||`|~|!|@|$|%|^|&|\*|-|_|=){1}(?=\s)|('|:)(?=s|\s)|(\(|\)|\[|\]|\{|\})", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex ScenifyRemoveChars = new Regex(@"(?<=\s)(,|<|>|\/|\\|;|:|'|""|\||`|~|!|\?|@|$|%|^|\*|-|_|=){1}(?=\s)|('|:|\?)(?=s|\s|$)|(\(|\)|\[|\]|\{|\})", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex ScenifyReplaceChars = new Regex(@"[\/]", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly char[] EpisodeTitleTrimCharacters = new[] { ' ', '.', '?' };