Düzenle

Aracılığıyla paylaş


Is Class

Definition

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

public class Is
type Is = class
Inheritance
Is
Derived

Constructors

Is()

Properties

All

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

BinarySerializable

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

Empty

Returns a constraint that tests for empty

False

Returns a constraint that tests for False

NaN

Returns a constraint that tests for NaN

Negative
Not

Returns a ConstraintExpression that negates any following constraint.

Null

Returns a constraint that tests for null

Ordered

Returns a constraint that tests whether a collection is ordered

Positive
True

Returns a constraint that tests for True

Unique

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

XmlSerializable

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

Methods

AssignableFrom(Type)

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

AssignableFrom<T>()

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

AssignableTo(Type)

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

AssignableTo<T>()

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

AtLeast(Object)

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

AtMost(Object)

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

EqualTo(Object)

Returns a constraint that tests two items for equality

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.

GreaterThan(Object)

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

GreaterThanOrEqualTo(Object)

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

InRange<T>(T, T)
InstanceOf(Type)

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

InstanceOf<T>()

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

LessThan(Object)

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

LessThanOrEqualTo(Object)

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

SameAs(Object)

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

SamePath(String)

Returns a constraint that tests whether the path provided is the same as an expected path after canonicalization.

SamePathOrUnder(String)

Returns a constraint that tests whether the path provided is the same path or under an expected path after canonicalization.

StringContaining(String)

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

StringEnding(String)

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

StringMatching(String)

Returns a constraint that succeeds if the actual value matches the regular expression supplied as an argument.

StringStarting(String)

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

SubPath(String)
SubsetOf(IEnumerable)

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

TypeOf(Type)

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

TypeOf<T>()

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

Applies to