Edytuj

Udostępnij za pośrednictwem


Has Class

Definition

Helper class with properties and methods that supply a number of constraints used in Asserts.

public class Has
type Has = class
Inheritance
Has

Constructors

Has()

Properties

All

Returns a ConstraintExpression, which will apply the following constraint to all members of a collection, succeeding if all of them succeed.

Count

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

InnerException

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

Length

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

Message

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

No

Returns a ConstraintExpression that negates any following constraint.

None

Returns a ConstraintExpression, which will apply the following constraint to all members of a collection, succeeding if all of them fail.

Some

Returns a ConstraintExpression, which will apply the following constraint to all members of a collection, succeeding if at least one of them succeeds.

Methods

Attribute(Type)

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

Attribute<T>()

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

Exactly(Int32)
Member(Object)

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

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.

Applies to