Assert - HervisDaubeny/HDUnitTesting GitHub Wiki

HDUnit.HDAssert

Type HDUnit.HDAssert


Method HDUnit.Assert.HDAssert.All1(System.Collections.Generic.IEnumerable{0},System.Action{``0})

Verifies that all items in the collection pass when executed against action.

Name Description
T: The type of the object to be verified
Name Description
----- ------
collection: The collection
action: The action to test each item against

Method HDUnit.Assert.HDAssert.Cast``1(System.Object)

Verifies that an object can be casted to the given type.

Name Description
T: The type the object should be casted to
Name Description
----- ------
object: The object to be evaluated
Returns: The object, casted to type T when successful

Method HDUnit.Assert.HDAssert.Contains(System.String,System.String)

Verifies that a string contains a given sub-string, using the current culture.

Name Description
expectedSubstring: The sub-string expected to be in the string
actualString: The string to be inspected

Method HDUnit.Assert.HDAssert.Contains1(System.Collections.Generic.IEnumerable{0},System.Predicate{``0})

Verifies that a collection contains a given object.

Name Description
T: The type of the object to be verified
Name Description
----- ------
collection: The collection to be inspected
filter: The filter used to find the item you're ensuring the collection contains

Method HDUnit.Assert.HDAssert.Contains1(0,System.Collections.Generic.IEnumerable{0},System.Collections.Generic.IEqualityComparer{0})

Verifies that a collection contains a given object, using an equality comparer.

Name Description
T: The type of the object to be verified
Name Description
----- ------
expected: The object expected to be in the collection
collection: The collection to be inspected
comparer: The comparer used to equate objects in the collection with the expected object

Method HDUnit.Assert.HDAssert.Contains1(0,System.Collections.Generic.IEnumerable{``0})

Verifies that a collection contains a given object.

Name Description
T: The type of the object to be verified
Name Description
----- ------
expected: The object expected to be in the collection
collection: The collection to be inspected

Method HDUnit.Assert.HDAssert.Contains(System.String,System.String,System.StringComparison)

Verifies that a string contains a given sub-string, using the given comparison type.

Name Description
expectedSubstring: The sub-string expected to be in the string
actualString: The string to be inspected
comparisonType: The type of string comparison to perform

Method HDUnit.Assert.HDAssert.DoesNotContain1(System.Collections.Generic.IEnumerable{0},System.Predicate{``0})

Verifies that a collection does not contain a given object.

Name Description
T: The type of the object to be compared
Name Description
----- ------
collection: The collection to be inspected
filter: The filter used to find the item you're ensuring the collection does not contain

Method HDUnit.Assert.HDAssert.DoesNotContain2(0,System.Collections.Generic.IReadOnlyDictionary{0,1})

Verifies that a dictionary does not contain a given key.

Name Description
TKey: The type of the keys of the object to be verified.
Name Description
----- ------
TValue: The type of the values of the object to be verified.
Name Description
----- ------
expected: The object expected not to be in the collection.
collection: The collection to be inspected.

Method HDUnit.Assert.HDAssert.DoesNotContain2(0,System.Collections.Generic.IDictionary{0,1})

Verifies that a dictionary does not contain a given key.

Name Description
TKey: The type of the keys of the object to be verified.
Name Description
----- ------
TValue: The type of the values of the object to be verified.
Name Description
----- ------
expected: The object expected not to be in the collection.
collection: The collection to be inspected.

Method HDUnit.Assert.HDAssert.DoesNotContain(System.String,System.String)

Verifies that a string does not contain a given sub-string, using the current culture.

Name Description
expectedSubstring: The sub-string which is expected not to be in the string
actualString: The string to be inspected

Method HDUnit.Assert.HDAssert.DoesNotContain(System.String,System.String,System.StringComparison)

Verifies that a string does not contain a given sub-string, using the given comparison type.

Name Description
expectedSubstring: The sub-string which is expected not to be in the string
actualString: The string to be inspected
comparisonType: The type of string comparison to perform

Method HDUnit.Assert.HDAssert.DoesNotContain1(0,System.Collections.Generic.IEnumerable{0},System.Collections.Generic.IEqualityComparer{0})

Verifies that a collection does not contain a given object, using an equality comparer.

Name Description
T: The type of the object to be compared
Name Description
----- ------
expected: The object that is expected not to be in the collection
collection: The collection to be inspected
comparer: The comparer used to equate objects in the collection with the expected object

Method HDUnit.Assert.HDAssert.DoesNotContain1(0,System.Collections.Generic.IEnumerable{``0})

Verifies that a collection does not contain a given object.

Name Description
T: The type of the object to be compared
Name Description
----- ------
expected: The object that is expected not to be in the collection
collection: The collection to be inspected

Method HDUnit.Assert.HDAssert.Empty(System.Collections.IEnumerable)

Verifies that a collection is empty.

Name Description
collection: The collection to be inspected

Method HDUnit.Assert.HDAssert.Empty1(System.Collections.Generic.IEnumerable{0})

Verifies that a collection is empty.

Name Description
T: The type of the collection to be examined
Name Description
----- ------
collection: The collection to be inspected

Method HDUnit.Assert.HDAssert.Equal1(0,``0)

Verifies that two objects are equal, using a default comparer.

Name Description
T: The type of the objects to be compared
Name Description
----- ------
expected: The expected value
actual: The value to be compared with

Method HDUnit.Assert.HDAssert.Equal1(0,``0,System.String)

Verifies that two objects are equal, using a default comparer.

Name Description
T: The type of the objects to be compared
Name Description
----- ------
expected: The expected value
actual: The value to be compared with
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.Equal1(0,0,System.Collections.Generic.IEqualityComparer{0})

Verifies that two objects are equal, using a custom equatable comparer.

Name Description
T: The type of the objects to be compared
Name Description
----- ------
expected: The expected value
actual: The value to be compared with
comparer: The comparer used to compare the two objects

Method HDUnit.Assert.HDAssert.Equal1(0,0,System.Collections.Generic.IEqualityComparer{0},System.String)

Verifies that two objects are equal, using a custom equatable comparer.

Name Description
T: The type of the objects to be compared
Name Description
----- ------
expected: The expected value
actual: The value to be compared with
comparer: The comparer used to compare the two objects
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.Equal(System.DateTime,System.DateTime,System.TimeSpan)

Verifies that two System.DateTime values are equal, within the precision given by precision.

Name Description
expected: The expected value
actual: The value to be compared with
precision: The allowed difference in time where the two dates are considered equal

Method HDUnit.Assert.HDAssert.Equal(System.DateTime,System.DateTime,System.TimeSpan,System.String)

Verifies that two System.DateTime values are equal, within the precision given by precision.

Name Description
expected: The expected value
actual: The value to be compared with
precision: The allowed difference in time where the two dates are considered equal
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.Equal1(System.Collections.Generic.IEnumerable{0},System.Collections.Generic.IEnumerable{0},System.Collections.Generic.IEqualityComparer{0})

Verifies that two sequences are equivalent, using a custom equatable comparer.

Name Description
T: The type of the objects to be compared
Name Description
----- ------
expected: The expected value
actual: The value to be compared with
comparer: The comparer used to compare the two objects
T:System.ArgumentNullException: Argument is null

Method HDUnit.Assert.HDAssert.Equal1(System.Collections.Generic.IEnumerable{0},System.Collections.Generic.IEnumerable{``0})

Verifies that two sequences are equivalent, using a default comparer.

Name Description
T: The type of the objects to be compared
Name Description
----- ------
expected: The expected value
actual: The value to be compared with
comparer: The comparer used to compare the two objects
T:System.ArgumentNullException: Argument is null

Method HDUnit.Assert.HDAssert.Equal(System.String,System.String,System.Boolean,System.Boolean,System.Boolean)

Verifies that two strings are equivalent.

Name Description
expected: The expected string value
actual: The actual string value
ignoreCase: If set to true, ignores case differences. The invariant culture is used
ignoreLineEndingDifferences: If set to true, treats \r\n, \r, and \n as equivalent
ignoreWhiteSpaceDifferences: If set to true, treats spaces, tabs, \r\n, \r, and \n (in any non-zero quantity) as equivalent

Method HDUnit.Assert.HDAssert.Equal(System.String,System.String)

Verifies that two strings are equivalent

Name Description
expected: The expected string value
actual: The actual string value

Method HDUnit.Assert.HDAssert.IsFalse(System.Boolean)

Verifies that given boolean is false.

Name Description
expected: The boolean expected to be false

Method HDUnit.Assert.HDAssert.IsFalse(System.Boolean,System.String)

Verifies that given boolean is false.

Name Description
expected: Boolean expected to be false
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.IsFalse1(0,System.Predicate{``0},System.String)

Verifies that running a predicate on an instance results in false.

Name Description
T: Type the predicate expects
Name Description
----- ------
t: Instance of type t
expected: The predicate to evaluate the instance with
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.IsNotNull(System.Object)

Verifies that the given object is not null.

Name Description
object: Object to be verified

Method HDUnit.Assert.HDAssert.IsNotNull(System.Object,System.String)

Verifies that the given object is not null.

Name Description
object: Object to be verified
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.IsNotNull1(0,System.Predicate{``0},System.String)

Verifies that running a predicate on an instance does not result in null.

Name Description
T: Type the predicate expects
Name Description
----- ------
t: Instance of type t
expected: The predicate to evaluate the instance with
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.IsNull(System.Object)

Verifies that the given object is not null.

Name Description
object: Object to be verified

Method HDUnit.Assert.HDAssert.IsNull(System.Object,System.String)

Verifies that the given object is not null.

Name Description
object: The object to be examined
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.IsNull1(0,System.Predicate{``0},System.String)

Verifies that running a predicate on an instance does result in null.

Name Description
T: Type the predicate expects
Name Description
----- ------
t: Instance of type t
expected: The predicate to evaluate the instance with
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.IsTrue(System.Boolean)

Verifies that given boolean is true.

Name Description
expected: Boolean expected to be true

Method HDUnit.Assert.HDAssert.IsTrue(System.Boolean,System.String)

Verifies that given boolean is true.

Name Description
expected: Boolean expected to be true
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.IsTrue1(0,System.Predicate{``0},System.String)

Verifies that running a predicate on an instance does result in true.

Name Description
T: Type the the predicate expects
Name Description
----- ------
t: Instance of type t
expected: The predicate to evaluate the instance with
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.InRange1(0,0,0)

Verifies that a value is within a given range.

Name Description
T: The type of the value to be compared
Name Description
----- ------
actual: The actual value to be evaluated
low: The (inclusive) low value of the range
high: The (inclusive) high value of the range

Method HDUnit.Assert.HDAssert.InRange1(0,0,0,System.Collections.Generic.IComparer{``0})

Verifies that a value is within a given range, using a comparer.

Name Description
T: The type of the value to be compared
Name Description
----- ------
actual: The actual value to be evaluated
low: The (inclusive) low value of the range
high: The (inclusive) high value of the range
comparer: The comparer used to evaluate the value's range

Method HDUnit.Assert.HDAssert.IsNotType(System.Type,System.Object)

Verifies that an object is not exactly the given type.

Name Description
expectedType: The type the object should not be
object: The object to be evaluated

Method HDUnit.Assert.HDAssert.IsNotType``1(System.Object)

Verifies that an object is not exactly the given type.

Name Description
T: The type the object should not be
Name Description
----- ------
object: The object to be evaluated

Method HDUnit.Assert.HDAssert.IsType``1(System.Object)

Verifies that an object is exactly the given type (and not a derived type).

Name Description
T: The type the object should be
Name Description
----- ------
object: The object to be evaluated
Returns: The object, casted to type T when successful

Method HDUnit.Assert.HDAssert.IsType(System.Type,System.Object)

Verifies that an object is exactly the given type (and not a derived type).

Name Description
expectedType: The type the object should be
object: The object to be evaluated

Method HDUnit.Assert.HDAssert.NotEmpty(System.Collections.IEnumerable)

Verifies that a collection is not empty.

Name Description
collection: The collection to be inspected

Method HDUnit.Assert.HDAssert.NotEqual1(0,``0,System.String)

Verifies that two objects are not equal, using a default comparer.

Name Description
T: The type of the objects to be compared
Name Description
----- ------
expected: The expected object
actual: The value to be compared with
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.NotEqual1(0,``0)

Verifies that two objects are not equal, using a default comparer.

Name Description
T: The type of the objects to be compared
Name Description
----- ------
expected: The expected object
actual: The value to be compared with

Method HDUnit.Assert.HDAssert.NotEqual1(0,0,System.Collections.Generic.IEqualityComparer{0})

Verifies that two objects are not equal, using a custom equality comparer.

Name Description
T: The type of the objects to be compared
Name Description
----- ------
expected: The expected object
actual: The value to be compared with
comparer: The comparer used to examine the objects

Method HDUnit.Assert.HDAssert.NotEqual1(0,0,System.Collections.Generic.IEqualityComparer{0},System.String)

Verifies that two objects are not equal, using a custom equality comparer.

Name Description
T: The type of the objects to be compared
Name Description
----- ------
expected: The expected object
actual: The value to be compared with
comparer: The comparer used to examine the objects
message: String used for custom exception message

Method HDUnit.Assert.HDAssert.NotEqual1(System.Collections.Generic.IEnumerable{0},System.Collections.Generic.IEnumerable{``0})

Verifies that all items of collections expected and actual are not equal

Name Description
T: The type of the objects to be compared
Name Description
----- ------
expected: The expected collection
actual: The collection to compare with

Method HDUnit.Assert.HDAssert.NotEqual1(System.Collections.Generic.IEnumerable{0},System.Collections.Generic.IEnumerable{0},System.Collections.Generic.IEqualityComparer{0})

Verifies that all items of collections expected nad actual are not equal

Name Description
T: The type of the objects to be compared
Name Description
----- ------
expected: The expected object
actual: The actual object

Method HDUnit.Assert.HDAssert.Throws``1(System.String,System.Func{System.Object})

Verifies that the exact exception is thrown (and not a derived exception type), where the exception derives from System.ArgumentException and has the given parameter name.

Name Description
T: Type of the expected exception
Name Description
----- ------
paramName: The parameter name that is expected to be in the exception
testCode: A delegate to the code to be tested
Returns: The exception that was thrown, when successful

Method HDUnit.Assert.HDAssert.Throws``1(System.String,System.Action)

Verifies that the exact exception is thrown (and not a derived exception type), where the exception derives from System.ArgumentException and has the given parameter name.

Name Description
T: Type of the expected exception
Name Description
----- ------
paramName: The parameter name that is expected to be in the exception
testCode: A delegate to the code to be tested
Returns:

Method HDUnit.Assert.HDAssert.Throws(System.Type,System.Action)

Verifies that the exact exception is thrown (and not a derived exception type).

Name Description
exceptionType: The type of the exception expected to be thrown
testCode: A delegate to the code to be tested
Returns: The exception that was thrown, when successful

Method HDUnit.Assert.HDAssert.Throws``1(System.Action)

Verifies that the exact exception is thrown (and not a derived exception type).

Name Description
T: The type of the exception expected to be thrown
Name Description
----- ------
testCode: A delegate to the code to be tested
Returns: The exception that was thrown, when successful

Method HDUnit.Assert.HDAssert.ThrowsAny``1(System.Action)

Verifies that the exact exception or a derived exception type is thrown.

Name Description
T: The type of the exception expected to be thrown
Name Description
----- ------
testCode: A delegate to the code to be tested
Returns: The exception that was thrown, when successful

Method HDUnit.Assert.HDAssert.ThrowsAny``1(System.Func{System.Object})

Verifies that the exact exception or a derived exception type is thrown. Generally used to test property accessors.

Name Description
T: The type of the exception expected to be thrown
Name Description
----- ------
testCode: A delegate to the code to be tested
Returns: The exception that was thrown, when successful