AssertionHelper AssertionHelper Class

Definition

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
AssertionHelperAssertionHelper

Constructors

AssertionHelper() AssertionHelper()

Methods

AssignableFrom(Type) 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>() 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) 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>() 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) 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) 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) Attribute(Type)

Returns a new AttributeConstraint checking for the presence of a particular attribute on an object.

(Inherited from ConstraintFactory)
Attribute<T>() Attribute<T>()

Returns a new AttributeConstraint checking for the presence of a particular attribute on an object.

(Inherited from ConstraintFactory)
Contains(Object) Contains(Object)

Returns a new CollectionContainsConstraint checking for the presence of a particular object in the collection.

(Inherited from ConstraintFactory)
Contains(String) 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) ContainsSubstring(String)

Returns a constraint that succeeds if the actual value contains the substring supplied as an argument.

(Inherited from ConstraintFactory)
DoesNotContain(String) DoesNotContain(String)

Returns a constraint that fails if the actual value contains the substring supplied as an argument.

(Inherited from ConstraintFactory)
DoesNotEndWith(String) DoesNotEndWith(String)

Returns a constraint that fails if the actual value ends with the substring supplied as an argument.

(Inherited from ConstraintFactory)
DoesNotMatch(String) DoesNotMatch(String)

Returns a constraint that fails if the actual value matches the pattern supplied as an argument.

(Inherited from ConstraintFactory)
DoesNotStartWith(String) DoesNotStartWith(String)

Returns a constraint that fails if the actual value starts with the substring supplied as an argument.

(Inherited from ConstraintFactory)
EndsWith(String) EndsWith(String)

Returns a constraint that succeeds if the actual value ends with the substring supplied as an argument.

(Inherited from ConstraintFactory)
EqualTo(Object) EqualTo(Object)

Returns a constraint that tests two items for equality

(Inherited from ConstraintFactory)
EquivalentTo(IEnumerable) 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) Expect(Boolean)

Asserts that a condition is true. If the condition is false the method throws an AssertionException. Works Identically to That(Boolean).

Expect(Boolean, String) 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, String, Object[]) 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(TestDelegate, IResolveConstraint) Expect(TestDelegate, IResolveConstraint)

Asserts that the code represented by a delegate throws an exception that satisfies the constraint provided.

Expect<T>(ActualValueDelegate<T>, IResolveConstraint) Expect<T>(ActualValueDelegate<T>, IResolveConstraint)
Expect<T>(ActualValueDelegate<T>, IResolveConstraint, String) Expect<T>(ActualValueDelegate<T>, IResolveConstraint, String)
Expect<T>(ActualValueDelegate<T>, IResolveConstraint, String, Object[]) Expect<T>(ActualValueDelegate<T>, IResolveConstraint, String, Object[])
Expect<T>(T, IResolveConstraint) Expect<T>(T, IResolveConstraint)
Expect<T>(T, IResolveConstraint) Expect<T>(T, IResolveConstraint)
Expect<T>(T, IResolveConstraint, String) Expect<T>(T, IResolveConstraint, String)
Expect<T>(T, IResolveConstraint, String) Expect<T>(T, IResolveConstraint, String)
Expect<T>(T, IResolveConstraint, String, Object[]) Expect<T>(T, IResolveConstraint, String, Object[])
Expect<T>(T, IResolveConstraint, String, Object[]) Expect<T>(T, IResolveConstraint, String, Object[])
GreaterThan(Object) GreaterThan(Object)

Returns a constraint that tests whether the actual value is greater than the suppled argument

(Inherited from ConstraintFactory)
GreaterThanOrEqualTo(Object) 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) InRange<T>(T, T) Inherited from ConstraintFactory
InstanceOf(Type) 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>() 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) LessThan(Object)

Returns a constraint that tests whether the actual value is less than the suppled argument

(Inherited from ConstraintFactory)
LessThanOrEqualTo(Object) 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) Map(ICollection)
Matches(String) Matches(String)

Returns a constraint that succeeds if the actual value matches the Regex pattern supplied as an argument.

(Inherited from ConstraintFactory)
Member(Object) Member(Object)

Returns a new CollectionContainsConstraint checking for the presence of a particular object in the collection.

(Inherited from ConstraintFactory)
Property(String) 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) SameAs(Object)

Returns a constraint that tests that two references are the same object

(Inherited from ConstraintFactory)
SamePath(String) 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) 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) StartsWith(String)

Returns a constraint that succeeds if the actual value starts with the substring supplied as an argument.

(Inherited from ConstraintFactory)
StringContaining(String) StringContaining(String)

Returns a constraint that succeeds if the actual value contains the substring supplied as an argument.

(Inherited from ConstraintFactory)
StringEnding(String) StringEnding(String)

Returns a constraint that succeeds if the actual value ends with the substring supplied as an argument.

(Inherited from ConstraintFactory)
StringMatching(String) StringMatching(String)

Returns a constraint that succeeds if the actual value matches the Regex pattern supplied as an argument.

(Inherited from ConstraintFactory)
StringStarting(String) StringStarting(String)

Returns a constraint that succeeds if the actual value starts with the substring supplied as an argument.

(Inherited from ConstraintFactory)
SubPath(String) SubPath(String) Inherited from ConstraintFactory
SubsetOf(IEnumerable) 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) 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>() TypeOf<T>()

Returns a constraint that tests whether the actual value is of the exact type supplied as an argument.

(Inherited from ConstraintFactory)

Properties

All 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 BinarySerializable

Returns a constraint that tests whether an object graph is serializable in binary format.

(Inherited from ConstraintFactory)
Count Count

Returns a new ConstraintExpression, which will apply the following constraint to the Count property of the object being tested.

(Inherited from ConstraintFactory)
Empty Empty

Returns a constraint that tests for empty

(Inherited from ConstraintFactory)
False False

Returns a constraint that tests for False

(Inherited from ConstraintFactory)
InnerException InnerException

Returns a new ConstraintExpression, which will apply the following constraint to the InnerException property of the object being tested.

(Inherited from ConstraintFactory)
Length Length

Returns a new ConstraintExpression, which will apply the following constraint to the Length property of the object being tested.

(Inherited from ConstraintFactory)
Message Message

Returns a new ConstraintExpression, which will apply the following constraint to the Message property of the object being tested.

(Inherited from ConstraintFactory)
NaN NaN

Returns a constraint that tests for NaN

(Inherited from ConstraintFactory)
Negative Negative Inherited from ConstraintFactory
No No

Returns a ConstraintExpression that negates any following constraint.

(Inherited from ConstraintFactory)
None 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 Not

Returns a ConstraintExpression that negates any following constraint.

(Inherited from ConstraintFactory)
Null Null

Returns a constraint that tests for null

(Inherited from ConstraintFactory)
Ordered Ordered

Returns a constraint that tests whether a collection is ordered

(Inherited from ConstraintFactory)
Positive Positive Inherited from ConstraintFactory
Some 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 True

Returns a constraint that tests for True

(Inherited from ConstraintFactory)
Unique Unique

Returns a constraint that tests whether a collection contains all unique items.

(Inherited from ConstraintFactory)
XmlSerializable XmlSerializable

Returns a constraint that tests whether an object graph is serializable in xml format.

(Inherited from ConstraintFactory)

Applies to