public static string GetFileNameFrom(Uri uri) { string filename; filename = uri.LocalPath.Split('/').Last(); filename = FileExts.ToSafeFileName(filename); return(filename); }
public void ConvertFileName_ToSafeFileName_ShouldPass_IsValidFileNameTest(string invalidFileName) { // Act string validFileName = FileExts.ToSafeFileName(invalidFileName); // Assert Assert.IsNotNull(validFileName); Assert.IsFalse(FileExts.IsFileNameValid(invalidFileName)); Assert.IsTrue(FileExts.IsFileNameValid(validFileName)); }