Skip to content

Commit

Permalink
#1849 add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Nov 29, 2024
1 parent 6ab99e7 commit d1fa81a
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,19 @@ public void FilenamesHelper_IsValidFileName(string filename, bool expected)
var result = FilenamesHelper.IsValidFileName(filename);
Assert.AreEqual(expected, result);
}

// Get parent path for FilenamesHelper.GetParentPath
[TestMethod]
[DataRow("/yes.jpg", "/")]
[DataRow("/sub/yes.jpg", "/sub")]
[DataRow("/sub/sub2/yes.jpg", "/sub/sub2")]
[DataRow("/sub/sub2/sub3/yes.jpg", "/sub/sub2/sub3")]
[DataRow("/sub/sub2/sub3/sub4/yes.jpg", "/sub/sub2/sub3/sub4")]
[DataRow("/sub/sub2/sub3/sub4/sub5/yes.jpg", "/sub/sub2/sub3/sub4/sub5")]
public void FilenamesHelper_GetParentPath(string filePath, string expected)
{
var result = FilenamesHelper.GetParentPath(filePath);
Assert.AreEqual(expected, result);
}

}

0 comments on commit d1fa81a

Please sign in to comment.