TestUtilities Class |
Namespace: Test.Framework
The TestUtilities type exposes the following members.
Name | Description | |
---|---|---|
AssertIsAttribute |
Throws an assertion if the type passed across is not sealed and is not based on Attribute.
| |
AssertIsException |
Throws an assertion if the type passed across is not an exception type, does not have the
correct constructors or is not serialisable.
| |
AssignPropertyValue |
Assigns a constant dummy value to a property on an object.
| |
ChangeType |
Converts a value from one type to another, as per the standard ChangeType(Object, Type),
except that this version can cope with the conversion of NullableT types.
| |
ConvertBitStringToBytes |
Converts a string of binary digits (with optional whitespace) to a collection of bytes.
| |
ConvertToBitString(Int32, Int32) |
Converts a value to a binary representation of a given length.
| |
ConvertToBitString(Int64, Int32) |
Converts a value to a binary representation of a given length.
| |
CreateMockImplementationT |
Creates a Moq stub for an object and registers it with the class factory. The instance returned by the method
is the one the code under test will always receive when it asks for an instantiation of the interface.
| |
CreateMockInstanceT |
Creates a Moq stub for an object but does not register it with the class factory.
| |
CreateMockSingletonT |
Creates a Moq mock object for a type that implements ISingletonT.
| |
SequenceEqualT |
Returns true if both sequences are null or if the LINQ SequenceEqual method returns true for them, otherwise returns false.
| |
TestProperty(Object, String, Boolean) |
Asserts that a bool property of an object has the given start value. Sets the property to the toggled start value and asserts that
the toggled value can then be read back from the property.
| |
TestProperty(Object, String, Object, Object) |
Asserts that a property of an object has a given start value and can be successfuly changed to another value.
| |
TestProperty(Object, String, Object, Object, Boolean) |
Asserts that a property of an object has a given start value and can be successfuly changed to another value.
| |
TestPropertyT(T, ExpressionFuncT, Object, Boolean) |
Asserts that a bool property of an object has the given start value. Sets the property to the toggled start value and asserts that
the toggled value can then be read back from the property.
| |
TestPropertyT(T, ExpressionFuncT, Object, Object, Object) |
Asserts that a property of an object has a given start value and can be successfuly changed to another value.
| |
TestPropertyT(T, ExpressionFuncT, Object, Object, Object, Boolean) |
Asserts that the property passed across starts at a given value and can be changed to another value.
| |
TestSimpleEquals |
Tests that an object whose Equals method tests all of its public properties is behaving correctly. Only
works with objects that have a simple constructor.
|