AssertionHelper Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
AssertionHelper is an optional base class for user tests, allowing the use of shorter names for constraints and asserts and avoiding conflict with the definition of Is, from which it inherits much of its behavior, in certain mock object frameworks.
public class AssertionHelper : NUnit.Framework.Constraints.ConstraintFactory
type AssertionHelper = class
inherit ConstraintFactory
- Inheritance
Constructors
AssertionHelper() |
Properties
All |
Returns a ConstraintExpression, which will apply the following constraint to all members of a collection, succeeding if all of them succeed. (Inherited from ConstraintFactory) |
BinarySerializable |
Returns a constraint that tests whether an object graph is serializable in binary format. (Inherited from ConstraintFactory) |
Count |
Returns a new ConstraintExpression, which will apply the following constraint to the Count property of the object being tested. (Inherited from ConstraintFactory) |
Empty |
Returns a constraint that tests for empty (Inherited from ConstraintFactory) |
False |
Returns a constraint that tests for False (Inherited from ConstraintFactory) |
InnerException |
Returns a new ConstraintExpression, which will apply the following constraint to the InnerException property of the object being tested. (Inherited from ConstraintFactory) |
Length |
Returns a new ConstraintExpression, which will apply the following constraint to the Length property of the object being tested. (Inherited from ConstraintFactory) |
Message |
Returns a new ConstraintExpression, which will apply the following constraint to the Message property of the object being tested. (Inherited from ConstraintFactory) |
NaN |
Returns a constraint that tests for NaN (Inherited from ConstraintFactory) |
Negative | (Inherited from ConstraintFactory) |
No |
Returns a ConstraintExpression that negates any following constraint. (Inherited from ConstraintFactory) |
None |
Returns a ConstraintExpression, which will apply the following constraint to all members of a collection, succeeding if all of them fail. (Inherited from ConstraintFactory) |
Not |
Returns a ConstraintExpression that negates any following constraint. (Inherited from ConstraintFactory) |
Null |
Returns a constraint that tests for null (Inherited from ConstraintFactory) |
Ordered |
Returns a constraint that tests whether a collection is ordered (Inherited from ConstraintFactory) |
Positive | (Inherited from ConstraintFactory) |
Some |
Returns a ConstraintExpression, which will apply the following constraint to all members of a collection, succeeding if at least one of them succeeds. (Inherited from ConstraintFactory) |
True |
Returns a constraint that tests for True (Inherited from ConstraintFactory) |
Unique |
Returns a constraint that tests whether a collection contains all unique items. (Inherited from ConstraintFactory) |
XmlSerializable |
Returns a constraint that tests whether an object graph is serializable in xml format. (Inherited from ConstraintFactory) |
Methods
AssignableFrom(Type) |
Returns a constraint that tests whether the actual value is assignable from the type supplied as an argument. (Inherited from ConstraintFactory) |
AssignableFrom<T>() |
Returns a constraint that tests whether the actual value is assignable from the type supplied as an argument. (Inherited from ConstraintFactory) |
AssignableTo(Type) |
Returns a constraint that tests whether the actual value is assignable from the type supplied as an argument. (Inherited from ConstraintFactory) |
AssignableTo<T>() |
Returns a constraint that tests whether the actual value is assignable from the type supplied as an argument. (Inherited from ConstraintFactory) |
AtLeast(Object) |
Returns a constraint that tests whether the actual value is greater than or equal to the suppled argument (Inherited from ConstraintFactory) |
AtMost(Object) |
Returns a constraint that tests whether the actual value is less than or equal to the suppled argument (Inherited from ConstraintFactory) |
Attribute(Type) |
Returns a new AttributeConstraint checking for the presence of a particular attribute on an object. (Inherited from ConstraintFactory) |
Attribute<T>() |
Returns a new AttributeConstraint checking for the presence of a particular attribute on an object. (Inherited from ConstraintFactory) |
Contains(Object) |
Returns a new CollectionContainsConstraint checking for the presence of a particular object in the collection. (Inherited from ConstraintFactory) |
Contains(String) |
Returns a new ContainsConstraint. This constraint will, in turn, make use of the appropriate second-level constraint, depending on the type of the actual argument. This overload is only used if the item sought is a string, since any other type implies that we are looking for a collection member. (Inherited from ConstraintFactory) |
ContainsSubstring(String) |
Returns a constraint that succeeds if the actual value contains the substring supplied as an argument. (Inherited from ConstraintFactory) |
DoesNotContain(String) |
Returns a constraint that fails if the actual value contains the substring supplied as an argument. (Inherited from ConstraintFactory) |
DoesNotEndWith(String) |
Returns a constraint that fails if the actual value ends with the substring supplied as an argument. (Inherited from ConstraintFactory) |
DoesNotMatch(String) |
Returns a constraint that fails if the actual value matches the pattern supplied as an argument. (Inherited from ConstraintFactory) |
DoesNotStartWith(String) |
Returns a constraint that fails if the actual value starts with the substring supplied as an argument. (Inherited from ConstraintFactory) |
EndsWith(String) |
Returns a constraint that succeeds if the actual value ends with the substring supplied as an argument. (Inherited from ConstraintFactory) |
EqualTo(Object) |
Returns a constraint that tests two items for equality (Inherited from ConstraintFactory) |
EquivalentTo(IEnumerable) |
Returns a constraint that tests whether the actual value is a collection containing the same elements as the collection supplied as an argument. (Inherited from ConstraintFactory) |
Expect(Boolean, String, Object[]) |
Asserts that a condition is true. If the condition is false the method throws an AssertionException. Works Identically to That(Boolean, String, Object[]). |
Expect(Boolean, String) |
Asserts that a condition is true. If the condition is false the method throws an AssertionException. Works Identically to That(Boolean, String). |
Expect(Boolean) |
Asserts that a condition is true. If the condition is false the method throws an AssertionException. Works Identically to That(Boolean). |
Expect(TestDelegate, IResolveConstraint) |
Asserts that the code represented by a delegate throws an exception that satisfies the constraint provided. |
Expect<T>(ActualValueDelegate<T>, IResolveConstraint, String, Object[]) | |
Expect<T>(ActualValueDelegate<T>, IResolveConstraint, String) | |
Expect<T>(ActualValueDelegate<T>, IResolveConstraint) | |
Expect<T>(T, IResolveConstraint, String, Object[]) | |
Expect<T>(T, IResolveConstraint, String, Object[]) | |
Expect<T>(T, IResolveConstraint, String) | |
Expect<T>(T, IResolveConstraint, String) | |
Expect<T>(T, IResolveConstraint) | |
Expect<T>(T, IResolveConstraint) | |
GreaterThan(Object) |
Returns a constraint that tests whether the actual value is greater than the suppled argument (Inherited from ConstraintFactory) |
GreaterThanOrEqualTo(Object) |
Returns a constraint that tests whether the actual value is greater than or equal to the suppled argument (Inherited from ConstraintFactory) |
InRange<T>(T, T) | (Inherited from ConstraintFactory) |
InstanceOf(Type) |
Returns a constraint that tests whether the actual value is of the type supplied as an argument or a derived type. (Inherited from ConstraintFactory) |
InstanceOf<T>() |
Returns a constraint that tests whether the actual value is of the type supplied as an argument or a derived type. (Inherited from ConstraintFactory) |
LessThan(Object) |
Returns a constraint that tests whether the actual value is less than the suppled argument (Inherited from ConstraintFactory) |
LessThanOrEqualTo(Object) |
Returns a constraint that tests whether the actual value is less than or equal to the suppled argument (Inherited from ConstraintFactory) |
Map(ICollection) | |
Matches(String) |
Returns a constraint that succeeds if the actual value matches the Regex pattern supplied as an argument. (Inherited from ConstraintFactory) |
Member(Object) |
Returns a new CollectionContainsConstraint checking for the presence of a particular object in the collection. (Inherited from ConstraintFactory) |
Property(String) |
Returns a new PropertyConstraintExpression, which will either test for the existence of the named property on the object being tested or apply any following constraint to that property. (Inherited from ConstraintFactory) |
SameAs(Object) |
Returns a constraint that tests that two references are the same object (Inherited from ConstraintFactory) |
SamePath(String) |
Returns a constraint that tests whether the path provided is the same as an expected path after canonicalization. (Inherited from ConstraintFactory) |
SamePathOrUnder(String) |
Returns a constraint that tests whether the path provided is the same path or under an expected path after canonicalization. (Inherited from ConstraintFactory) |
StartsWith(String) |
Returns a constraint that succeeds if the actual value starts with the substring supplied as an argument. (Inherited from ConstraintFactory) |
StringContaining(String) |
Returns a constraint that succeeds if the actual value contains the substring supplied as an argument. (Inherited from ConstraintFactory) |
StringEnding(String) |
Returns a constraint that succeeds if the actual value ends with the substring supplied as an argument. (Inherited from ConstraintFactory) |
StringMatching(String) |
Returns a constraint that succeeds if the actual value matches the Regex pattern supplied as an argument. (Inherited from ConstraintFactory) |
StringStarting(String) |
Returns a constraint that succeeds if the actual value starts with the substring supplied as an argument. (Inherited from ConstraintFactory) |
SubPath(String) | (Inherited from ConstraintFactory) |
SubsetOf(IEnumerable) |
Returns a constraint that tests whether the actual value is a subset of the collection supplied as an argument. (Inherited from ConstraintFactory) |
TypeOf(Type) |
Returns a constraint that tests whether the actual value is of the exact type supplied as an argument. (Inherited from ConstraintFactory) |
TypeOf<T>() |
Returns a constraint that tests whether the actual value is of the exact type supplied as an argument. (Inherited from ConstraintFactory) |