Example #1
0
 public void With_Null_String()
 => ResultParsers
 .Long(null)
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <long>(
         null
         )
     );
Example #2
0
 public void With_Invalid_String()
 => ResultParsers
 .Enum <AssertionUtilities.Gender>("foobar")
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <AssertionUtilities.Gender>(
         "foobar"
         )
     );
Example #3
0
 public void With_Null_String()
 => ResultParsers
 .Decimal(null)
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <decimal>(
         null
         )
     );
Example #4
0
 public void With_Null_String()
 => ResultParsers
 .Enum <AssertionUtilities.Gender>(null)
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <AssertionUtilities.Gender>(
         null
         )
     );
Example #5
0
 public void With_Valid_String_With_Ignore_Case_Set_To_False()
 => ResultParsers
 .Enum <AssertionUtilities.Gender>("malE", false)
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <AssertionUtilities.Gender>(
         "malE"
         )
     );
Example #6
0
 public void With_Null_String_With_DateTimeStyle()
 => ResultParsers
 .DateTime(null, DateTimeStyles.None, CultureInfo.InvariantCulture)
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <System.DateTime>(
         null
         )
     );
Example #7
0
 public void With_Invalid_String()
 => ResultParsers
 .DateTime("foobar")
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <System.DateTime>(
         "foobar"
         )
     );
Example #8
0
 public void With_Invalid_String()
 => ResultParsers
 .Long("foobar")
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <long>(
         "foobar"
         )
     );
Example #9
0
 public void With_Null_String()
 => ResultParsers
 .DateTime(null)
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <System.DateTime>(
         null
         )
     );
Example #10
0
        public void With_Invalid_String_Digits_With_Hyphens_Wrapped_In_Parentheses()
        {
            var guid = "foobar";

            ResultParsers
            .GuidExact(guid, GuidFormat.DigitsWithHyphensWrappedInParentheses)
            .AssertError(AssertionUtilities.FormatStringParserMessage <Guid>("foobar"));
        }
Example #11
0
 public void With_Null_String_With_NumberStyle()
 => ResultParsers
 .Long(null, NumberStyles.Any, CultureInfo.InvariantCulture)
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <long>(
         null
         )
     );
Example #12
0
 public void With_Invalid_String_With_NumberStyle()
 => ResultParsers
 .Double("foobar", NumberStyles.Any, CultureInfo.InvariantCulture)
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <double>(
         "foobar"
         )
     );
Example #13
0
 public void With_Invalid_String_Using_Single_Format()
 => ResultParsers
 .DateTimeExact(
     "foobar",
     Format,
     DateTimeStyles.None,
     CultureInfo.InvariantCulture
     )
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <System.DateTime>(
         "foobar"
         )
     );
Example #14
0
 public void With_Null_String_Using_Multiple_Formats()
 => ResultParsers
 .DateTimeExact(
     null,
     Formats,
     DateTimeStyles.None,
     CultureInfo.InvariantCulture
     )
 .AssertError(
     AssertionUtilities.FormatStringParserMessage <System.DateTime>(
         null
         )
     );
Example #15
0
 public void With_Invalid_String_Digits_Only() =>
 ResultParsers
 .GuidExact("foobar", GuidFormat.DigitsOnly)
 .AssertError(AssertionUtilities.FormatStringParserMessage <Guid>("foobar"));
Example #16
0
 public void With_Null_String_Digits_With_Hyphens_Wrapped_In_Parentheses() =>
 ResultParsers
 .GuidExact(null, GuidFormat.DigitsWithHyphensWrappedInParentheses)
 .AssertError(AssertionUtilities.FormatStringParserMessage <Guid>(null));
Example #17
0
 public void With_Null_String_Digits_With_Four_HexaDecimals() =>
 ResultParsers
 .GuidExact(null, GuidFormat.FourHexadecimalWrappedInBrackets)
 .AssertError(AssertionUtilities.FormatStringParserMessage <Guid>(null));
Example #18
0
 public void With_Null_String_Digits_Only() =>
 ResultParsers
 .GuidExact(null, GuidFormat.DigitsOnly)
 .AssertError(AssertionUtilities.FormatStringParserMessage <Guid>(null));