Summer.Batch.Common.Util.Assert Class Reference
Static Public Member Functions | |
static void | IsTrue (bool expression, string message=null) |
Asserts a boolean expression. More... | |
static void | IsNull (object obj, string message=null) |
Asserts that an object is null. More... | |
static void | NotNull (object obj, string message=null) |
Asserts that an object is not null. More... | |
static void | HasLength (string text, string message=null) |
Asserts that a string is not null and is not empty. More... | |
static void | HasText (string text, string message=null) |
Asserts that a string is not null and contains at least one non-whitespace character. More... | |
static void | DoesNotContain (string textToSearch, string substring, string message=null) |
Asserts that a string does not contain a substring. More... | |
static void | NotEmpty (object[] array, string message=null) |
Asserts that an array is not null and that its length is greater than zero. More... | |
static void | NoNullElements (object[] array, string message=null) |
Asserts that an array has no null elements. More... | |
static void | NotEmpty< T > (ICollection< T > collection, string message=null) |
Asserts that a dictionary is not empty. More... | |
static void | NotEmpty< TKey, TValue > (IDictionary< TKey, TValue > dictionary, string message=null) |
Asserts that a dictionary is not empty. More... | |
static void | IsInstanceOf (Type type, object obj, string message=null) |
Asserts than an object is instance of a type. More... | |
static void | IsAssignable (Type superType, Type subType, string message=null) |
Asserts that a supertype is assignable from a subtype. More... | |
static void | State (bool expression, string message=null) |
Asserts than an expression evaluates to true . More... | |
Detailed Description
Static Assert Helper.
Member Function Documentation
|
static |
Asserts that a string does not contain a substring.
- Parameters
-
textToSearch the string to search substring the substring to find message the message to use if assertion fails
- Exceptions
-
ArgumentException if the substring is found in text
|
static |
Asserts that a string is not null and is not empty.
- Parameters
-
text the string to check message the message to use if assertion fails
- Exceptions
-
ArgumentException if the string is null or empty
|
static |
Asserts that a string is not null and contains at least one non-whitespace character.
- Parameters
-
text the string to check message the message to use if assertion fails
- Exceptions
-
ArgumentException if the string is null or does not contain text
|
static |
Asserts that a supertype is assignable from a subtype.
- Parameters
-
superType the supertype to check subType the subtype to check message the message to use if assertion fails
///
- Exceptions
-
ArgumentException if supertype is not assignable from subtype
|
static |
Asserts than an object is instance of a type.
- Parameters
-
type the type the object must be instance of obj the object to check message the message to use if assertion fails
- Exceptions
-
ArgumentException if the object is not an instance of type
|
static |
Asserts that an object is null.
- Parameters
-
obj the object to check message the message to use if assertion fails
- Exceptions
-
ArgumentException if the object is not null
|
static |
Asserts a boolean expression.
- Parameters
-
expression a boolean expression message the message to use if assertion fails
- Exceptions
-
ArgumentException if the expression is evaluated to false
|
static |
Asserts that an array has no null elements.
- Parameters
-
array the array to check message the message to use if assertion fails
- Exceptions
-
ArgumentException if the array is null or contains a null element
|
static |
Asserts that an array is not null and that its length is greater than zero.
- Parameters
-
array the array to check message the message to use if assertion fails
- Exceptions
-
ArgumentException if the array is null or empty
|
static |
Asserts that a dictionary is not empty.
- Template Parameters
-
T The type of the elements in the dictionary
- Parameters
-
collection the dictionary to check message the message to use if assertion fails
- Exceptions
-
ArgumentException if the collection is null or empty
|
static |
Asserts that a dictionary is not empty.
- Template Parameters
-
TKey the type of the keys TValue the type of the values
- Parameters
-
dictionary the dictionary to check message the message to use if assertion fails
- Exceptions
-
ArgumentException if the dictionary is null or empty
|
static |
Asserts that an object is not null.
- Parameters
-
obj the object to check message the message to use if assertion fails
- Exceptions
-
ArgumentNullException if the object is null
|
static |
Asserts than an expression evaluates to true
.
- Parameters
-
expression the expression to check message the message to use if assertion fails
- Exceptions
-
InvalidOperationException if expression evaluates to false
The documentation for this class was generated from the following file:
- Summer.Batch.Common/Util/Assert.cs