Esempio n. 1
0
        public static string GetFileNameFrom(Uri uri)
        {
            string filename;

            filename = uri.LocalPath.Split('/').Last();
            filename = FileExts.ToSafeFileName(filename);
            return(filename);
        }
Esempio n. 2
0
        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));
        }