public static void IsFileName( [NotNull] string path, [NotNull, InvokerParameterName] string argName) { Code.NotNullNorEmpty(path, argName); if (!PathHelper.IsFileName(path)) { throw IoCodeExceptions.ArgumentNotFileName(argName, path); } }
public void TestIsFileName(string path, bool?state) { switch (state) { case null: Assert.Throws <ArgumentException>(() => PathHelper.IsFileName(path)); break; case true: Assert.AreEqual(PathHelper.IsFileName(path), true); break; case false: Assert.AreEqual(PathHelper.IsFileName(path), false); break; default: throw new ArgumentOutOfRangeException(nameof(state), state, null); } }