Esempio n. 1
0
 public void Apply_StringEmptyFormat_ThrowsArugmentException()
 {
     ExceptionAssert.CatchArgumentException(() =>
     {
         StringFormatter.Apply(new object(), string.Empty, null, null);
     },
                                            "format",
                                            "Value cannot be an empty string.");
 }
Esempio n. 2
0
 public void Ctor_InvalidPatternSql_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException(() =>
     {
         new WildcardPattern("%%", WildcardPatternOptions.SqlWildcards, StringComparison.CurrentCulture);
     },
                                            "pattern",
                                            "The wildcard pattern is invalid.");
 }
Esempio n. 3
0
 public void Create_Length6ByteArray_throwsArgumentException()
 {
     ExceptionAssert.CatchArgumentException(() =>
     {
         Timestamp.Create(new byte[] { 1, 2, 3, 4, 5, 6 });
     },
                                            "bytes",
                                            "The byte array should have size of 8.");
 }
Esempio n. 4
0
 public void Ctor_InvalidPattern_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException(() =>
     {
         new WildcardPattern("**");
     },
                                            "pattern",
                                            "The wildcard pattern is invalid.");
 }
Esempio n. 5
0
 public void Add_NotIFormattebleType_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException(() =>
     {
         var collection = new FormattingArgumentsCollection();
         collection.Add(typeof(Type), "");
     },
                                            "type",
                                            "The argument must implement System.IFormattable.");
 }
Esempio n. 6
0
 public void Add_DuplicateKey_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException(() =>
     {
         var collection = new FormattingArgumentsCollection();
         collection.Add(typeof(Int32), "New");
         collection.Add(typeof(Int32), "Update");
     },
                                            null,
                                            "An item with the same key has already been added.");
 }
Esempio n. 7
0
 public void CompareTo_newObject_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException
         (() =>
     {
         object other = new object();
         TestStruct.CompareTo(other);
     },
         "obj",
         "Argument must be Elo."
         );
 }
Esempio n. 8
0
 public void CompareTo_null_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException
         (() =>
     {
         object other = null;
         TestStruct.CompareTo(other);
     },
         "obj",
         "Argument must be EmailAddress."
         );
 }
Esempio n. 9
0
 public void CompareTo_null_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException
         (() =>
     {
         object other = null;
         var act      = TestStruct.CompareTo(other);
     },
         "obj",
         "Argument must be a percentage"
         );
 }
Esempio n. 10
0
 public void CompareTo_null_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException
         (() =>
     {
         object other = null;
         TestStruct.CompareTo(other);
     },
         "obj",
         "Argument must be InternetMediaType."
         );
 }
Esempio n. 11
0
 public void CompareTo_newObject_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException
         (() =>
     {
         object other = new object();
         var act      = TestStruct.CompareTo(other);
     },
         "obj",
         "Argument must be a local date time"
         );
 }
Esempio n. 12
0
 public void CompareTo_null_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException
         (() =>
     {
         object other = null;
         TestStruct.CompareTo(other);
     },
         "obj",
         "Argument must be CryptographicSeed."
         );
 }
Esempio n. 13
0
 public void CompareTo_newObject_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException
         (() =>
     {
         object other = new object();
         TestStruct.CompareTo(other);
     },
         "obj",
         "Argument must be InternationalBankAccountNumber."
         );
 }
Esempio n. 14
0
 public void CompareTo_null_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException
         (() =>
     {
         object other = null;
         TestStruct.CompareTo(other);
     },
         "obj",
         "Argument must be BusinessIdentifierCode."
         );
 }
Esempio n. 15
0
 public void CompareTo_newObject_ThrowsArgumentException()
 {
     ExceptionAssert.CatchArgumentException
         (() =>
     {
         object other = new object();
         var act      = TestStruct.CompareTo(other);
     },
         "obj",
         "Argument must be a cryptographic seed"
         );
 }