public void GuardForNullOrWhiteSpaceMustThorwArgumentNullExceptionWhenTheStringIsNull()
        {
            string? @string  = null;
            Type    expected = GetArgumentNullExceptionType();

            Assert.Throws(expected, () =>
                          StringGuard.ForNullOrWhiteSpace(@string, nameof(@string)));
        }
        public void GuardForNullOrWhiteSpaceMustNotThorwArgumentNullExceptionWhenTheStringHasValue()
        {
            var @string   = "Is not null.";
            var exception = Record.Exception(()
                                             => StringGuard.ForNullOrWhiteSpace(@string, nameof(@string)));

            Assert.Null(exception);
        }
        public void GuardForNullOrEmptyMustThorwArgumentNullExceptionWhenTheStringIsEmpty()
        {
            var  @string  = string.Empty;
            Type expected = GetArgumentNullExceptionType();

            Assert.Throws(expected, () =>
                          StringGuard.ForNullOrEmpty(@string, nameof(@string)));
        }
예제 #4
0
 public void ThisRoute()
 {
     stringGuard = new StringGuard();
 }