예제 #1
0
파일: IoCode.cs 프로젝트: alezhuk/CodeJam
 public static void IsFileName(
     [NotNull] string path,
     [NotNull, InvokerParameterName] string argName)
 {
     Code.NotNullNorEmpty(path, argName);
     if (!PathHelper.IsFileName(path))
     {
         throw IoCodeExceptions.ArgumentNotFileName(argName, path);
     }
 }
예제 #2
0
        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);
            }
        }