private static string GetValidatedName(string name) { name.ThrowIfNull(nameof(name)); name.ThrowIfEmpty(nameof(name)); var fileName = PathValidator.GetLastPathSegment(name); fileName.ThrowIfEmpty(nameof(name)); PathValidator.ValidateFilePath(fileName); return(fileName); }
public void TestValidateGetFileName(string path, string result) { Assert.AreEqual(PathValidator.GetLastPathSegment(path), result); }