-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
75 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using MangaReader.Core.Services; | ||
using NUnit.Framework; | ||
|
||
namespace Tests.API | ||
{ | ||
[TestFixture] | ||
class FolderNameNormalization | ||
{ | ||
[Test, Sequential] | ||
public void CheckNotAllowedNames([Values( | ||
"test" | ||
,@"C:\manga\manga:name" | ||
,@"usr\home\manga:name" | ||
,@"start < > : "" / \ | ? * end" | ||
,"\x15\x3D" // less than ASCII space | ||
,"\x21\x3D" // HEX of !, valid | ||
,"\x3F\x3D" // HEX of ?, not valid | ||
,@"C:\manga\ trailing space " | ||
,@"C:\manga\...trailing period..." | ||
,@"C:\manga\..." // Bad manga name get the root folder, bug =_= | ||
,@"C:\manga\CON" | ||
,@"C:\manga\CON.txt" | ||
,@"CON" | ||
,@"C:\manga\con.txt\context" | ||
,@"home\NUL.liza" | ||
,@"home\ NUL.liza" | ||
)] string name, [Values( | ||
"test" | ||
,@"C:\manga\manga.name" | ||
,@"usr\home\manga.name" | ||
,@"start . . . . . \ . . . end" | ||
,".=" | ||
,"!=" | ||
,".=" | ||
,@"C:\manga\ trailing space" | ||
,@"C:\manga\...trailing period" | ||
,@"C:\manga\" | ||
,@"C:\manga\.CON" | ||
,@"C:\manga\.CON.txt" | ||
,@".CON" | ||
,@"C:\manga\.CON.txt\context" | ||
,@"home\.NUL.liza" | ||
,@"home\ NUL.liza" | ||
)] string expected) | ||
{ | ||
Assert.AreEqual(expected, DirectoryHelpers.MakeValidPath(name)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters