IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Framework.Constraints.ConstraintFactory Class Reference

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

+ Inheritance diagram for NUnit.Framework.Constraints.ConstraintFactory:

Public Member Functions

ResolvableConstraintExpression Property (string name)
 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. More...
 
ResolvableConstraintExpression Attribute (Type expectedType)
 Returns a new AttributeConstraint checking for the presence of a particular attribute on an object. More...
 
ResolvableConstraintExpression Attribute< TExpected > ()
 Returns a new AttributeConstraint checking for the presence of a particular attribute on an object. More...
 
EqualConstraint EqualTo (object expected)
 Returns a constraint that tests two items for equality More...
 
SameAsConstraint SameAs (object expected)
 Returns a constraint that tests that two references are the same object More...
 
GreaterThanConstraint GreaterThan (object expected)
 Returns a constraint that tests whether the actual value is greater than the supplied argument More...
 
GreaterThanOrEqualConstraint GreaterThanOrEqualTo (object expected)
 Returns a constraint that tests whether the actual value is greater than or equal to the supplied argument More...
 
GreaterThanOrEqualConstraint AtLeast (object expected)
 Returns a constraint that tests whether the actual value is greater than or equal to the supplied argument More...
 
LessThanConstraint LessThan (object expected)
 Returns a constraint that tests whether the actual value is less than the supplied argument More...
 
LessThanOrEqualConstraint LessThanOrEqualTo (object expected)
 Returns a constraint that tests whether the actual value is less than or equal to the supplied argument More...
 
LessThanOrEqualConstraint AtMost (object expected)
 Returns a constraint that tests whether the actual value is less than or equal to the supplied argument More...
 
ExactTypeConstraint TypeOf (Type expectedType)
 Returns a constraint that tests whether the actual value is of the exact type supplied as an argument. More...
 
ExactTypeConstraint TypeOf< TExpected > ()
 Returns a constraint that tests whether the actual value is of the exact type supplied as an argument. More...
 
InstanceOfTypeConstraint InstanceOf (Type expectedType)
 Returns a constraint that tests whether the actual value is of the type supplied as an argument or a derived type. More...
 
InstanceOfTypeConstraint InstanceOf< TExpected > ()
 Returns a constraint that tests whether the actual value is of the type supplied as an argument or a derived type. More...
 
AssignableFromConstraint AssignableFrom (Type expectedType)
 Returns a constraint that tests whether the actual value is assignable from the type supplied as an argument. More...
 
AssignableFromConstraint AssignableFrom< TExpected > ()
 Returns a constraint that tests whether the actual value is assignable from the type supplied as an argument. More...
 
AssignableToConstraint AssignableTo (Type expectedType)
 Returns a constraint that tests whether the actual value is assignable from the type supplied as an argument. More...
 
AssignableToConstraint AssignableTo< TExpected > ()
 Returns a constraint that tests whether the actual value is assignable from the type supplied as an argument. More...
 
CollectionEquivalentConstraint EquivalentTo (IEnumerable expected)
 Returns a constraint that tests whether the actual value is a collection containing the same elements as the collection supplied as an argument. More...
 
CollectionSubsetConstraint SubsetOf (IEnumerable expected)
 Returns a constraint that tests whether the actual value is a subset of the collection supplied as an argument. More...
 
CollectionSupersetConstraint SupersetOf (IEnumerable expected)
 Returns a constraint that tests whether the actual value is a superset of the collection supplied as an argument. More...
 
CollectionContainsConstraint Member (object expected)
 Returns a new CollectionContainsConstraint checking for the presence of a particular object in the collection. More...
 
CollectionContainsConstraint Contains (object expected)
 Returns a new CollectionContainsConstraint checking for the presence of a particular object in the collection. More...
 
ContainsConstraint Contains (string expected)
 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. More...
 
SubstringConstraint StringContaining (string expected)
 Returns a constraint that succeeds if the actual value contains the substring supplied as an argument. More...
 
SubstringConstraint ContainsSubstring (string expected)
 Returns a constraint that succeeds if the actual value contains the substring supplied as an argument. More...
 
SubstringConstraint DoesNotContain (string expected)
 Returns a constraint that fails if the actual value contains the substring supplied as an argument. More...
 
StartsWithConstraint StartWith (string expected)
 Returns a constraint that succeeds if the actual value starts with the substring supplied as an argument. More...
 
StartsWithConstraint StartsWith (string expected)
 Returns a constraint that succeeds if the actual value starts with the substring supplied as an argument. More...
 
StartsWithConstraint StringStarting (string expected)
 Returns a constraint that succeeds if the actual value starts with the substring supplied as an argument. More...
 
StartsWithConstraint DoesNotStartWith (string expected)
 Returns a constraint that fails if the actual value starts with the substring supplied as an argument. More...
 
EndsWithConstraint EndWith (string expected)
 Returns a constraint that succeeds if the actual value ends with the substring supplied as an argument. More...
 
EndsWithConstraint EndsWith (string expected)
 Returns a constraint that succeeds if the actual value ends with the substring supplied as an argument. More...
 
EndsWithConstraint StringEnding (string expected)
 Returns a constraint that succeeds if the actual value ends with the substring supplied as an argument. More...
 
EndsWithConstraint DoesNotEndWith (string expected)
 Returns a constraint that fails if the actual value ends with the substring supplied as an argument. More...
 
RegexConstraint Match (string pattern)
 Returns a constraint that succeeds if the actual value matches the regular expression supplied as an argument. More...
 
RegexConstraint Matches (string pattern)
 Returns a constraint that succeeds if the actual value matches the regular expression supplied as an argument. More...
 
RegexConstraint StringMatching (string pattern)
 Returns a constraint that succeeds if the actual value matches the regular expression supplied as an argument. More...
 
RegexConstraint DoesNotMatch (string pattern)
 Returns a constraint that fails if the actual value matches the pattern supplied as an argument. More...
 
SamePathConstraint SamePath (string expected)
 Returns a constraint that tests whether the path provided is the same as an expected path after canonicalization. More...
 
SubPathConstraint SubPathOf (string expected)
 Returns a constraint that tests whether the path provided is a subpath of the expected path after canonicalization. More...
 
SamePathOrUnderConstraint SamePathOrUnder (string expected)
 Returns a constraint that tests whether the path provided is the same path or under an expected path after canonicalization. More...
 
RangeConstraint InRange (IComparable from, IComparable to)
 Returns a constraint that tests whether the actual value falls within a specified range. More...
 

Static Public Member Functions

static ConstraintExpression Exactly (int expectedCount)
 Returns a ConstraintExpression, which will apply the following constraint to all members of a collection, succeeding only if a specified number of them succeed. More...
 

Properties

ConstraintExpression Not [get]
 Returns a ConstraintExpression that negates any following constraint. More...
 
ConstraintExpression No [get]
 Returns a ConstraintExpression that negates any following constraint. More...
 
ConstraintExpression All [get]
 Returns a ConstraintExpression, which will apply the following constraint to all members of a collection, succeeding if all of them succeed. More...
 
ConstraintExpression Some [get]
 Returns a ConstraintExpression, which will apply the following constraint to all members of a collection, succeeding if at least one of them succeeds. More...
 
ConstraintExpression None [get]
 Returns a ConstraintExpression, which will apply the following constraint to all members of a collection, succeeding if all of them fail. More...
 
ResolvableConstraintExpression Length [get]
 Returns a new ConstraintExpression, which will apply the following constraint to the Length property of the object being tested. More...
 
ResolvableConstraintExpression Count [get]
 Returns a new ConstraintExpression, which will apply the following constraint to the Count property of the object being tested. More...
 
ResolvableConstraintExpression Message [get]
 Returns a new ConstraintExpression, which will apply the following constraint to the Message property of the object being tested. More...
 
ResolvableConstraintExpression InnerException [get]
 Returns a new ConstraintExpression, which will apply the following constraint to the InnerException property of the object being tested. More...
 
NullConstraint Null [get]
 Returns a constraint that tests for null More...
 
TrueConstraint True [get]
 Returns a constraint that tests for True More...
 
FalseConstraint False [get]
 Returns a constraint that tests for False More...
 
GreaterThanConstraint Positive [get]
 Returns a constraint that tests for a positive value More...
 
LessThanConstraint Negative [get]
 Returns a constraint that tests for a negative value More...
 
NaNConstraint NaN [get]
 Returns a constraint that tests for NaN More...
 
EmptyConstraint Empty [get]
 Returns a constraint that tests for empty More...
 
UniqueItemsConstraint Unique [get]
 Returns a constraint that tests whether a collection contains all unique items. More...
 
BinarySerializableConstraint BinarySerializable [get]
 Returns a constraint that tests whether an object graph is serializable in binary format. More...
 
XmlSerializableConstraint XmlSerializable [get]
 Returns a constraint that tests whether an object graph is serializable in xml format. More...
 
CollectionOrderedConstraint Ordered [get]
 Returns a constraint that tests whether a collection is ordered More...
 

Detailed Description

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

Member Function Documentation

static ConstraintExpression NUnit.Framework.Constraints.ConstraintFactory.Exactly ( int  expectedCount)
inlinestatic

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

References NUnit.Framework.Has.Exactly().

ResolvableConstraintExpression NUnit.Framework.Constraints.ConstraintFactory.Property ( string  name)
inline

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.

References NUnit.Framework.Has.Property().

ResolvableConstraintExpression NUnit.Framework.Constraints.ConstraintFactory.Attribute ( Type  expectedType)
inline

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

References NUnit.Framework.Has.Attribute().

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

EqualConstraint NUnit.Framework.Constraints.ConstraintFactory.EqualTo ( object  expected)
inline

Returns a constraint that tests two items for equality

SameAsConstraint NUnit.Framework.Constraints.ConstraintFactory.SameAs ( object  expected)
inline

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

GreaterThanConstraint NUnit.Framework.Constraints.ConstraintFactory.GreaterThan ( object  expected)
inline

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

GreaterThanOrEqualConstraint NUnit.Framework.Constraints.ConstraintFactory.GreaterThanOrEqualTo ( object  expected)
inline

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

GreaterThanOrEqualConstraint NUnit.Framework.Constraints.ConstraintFactory.AtLeast ( object  expected)
inline

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

LessThanConstraint NUnit.Framework.Constraints.ConstraintFactory.LessThan ( object  expected)
inline

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

LessThanOrEqualConstraint NUnit.Framework.Constraints.ConstraintFactory.LessThanOrEqualTo ( object  expected)
inline

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

LessThanOrEqualConstraint NUnit.Framework.Constraints.ConstraintFactory.AtMost ( object  expected)
inline

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

ExactTypeConstraint NUnit.Framework.Constraints.ConstraintFactory.TypeOf ( Type  expectedType)
inline

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

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

InstanceOfTypeConstraint NUnit.Framework.Constraints.ConstraintFactory.InstanceOf ( Type  expectedType)
inline

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

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

AssignableFromConstraint NUnit.Framework.Constraints.ConstraintFactory.AssignableFrom ( Type  expectedType)
inline

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

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

AssignableToConstraint NUnit.Framework.Constraints.ConstraintFactory.AssignableTo ( Type  expectedType)
inline

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

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

CollectionEquivalentConstraint NUnit.Framework.Constraints.ConstraintFactory.EquivalentTo ( IEnumerable  expected)
inline

Returns a constraint that tests whether the actual value is a collection containing the same elements as the collection supplied as an argument.

CollectionSubsetConstraint NUnit.Framework.Constraints.ConstraintFactory.SubsetOf ( IEnumerable  expected)
inline

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

CollectionSupersetConstraint NUnit.Framework.Constraints.ConstraintFactory.SupersetOf ( IEnumerable  expected)
inline

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

CollectionContainsConstraint NUnit.Framework.Constraints.ConstraintFactory.Member ( object  expected)
inline

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

CollectionContainsConstraint NUnit.Framework.Constraints.ConstraintFactory.Contains ( object  expected)
inline

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

ContainsConstraint NUnit.Framework.Constraints.ConstraintFactory.Contains ( string  expected)
inline

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.

SubstringConstraint NUnit.Framework.Constraints.ConstraintFactory.StringContaining ( string  expected)
inline

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

SubstringConstraint NUnit.Framework.Constraints.ConstraintFactory.ContainsSubstring ( string  expected)
inline

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

SubstringConstraint NUnit.Framework.Constraints.ConstraintFactory.DoesNotContain ( string  expected)
inline

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

References NUnit.Framework.Constraints.ConstraintExpression.ContainsSubstring(), and NUnit.Framework.Constraints.ConstraintExpression.Not.

StartsWithConstraint NUnit.Framework.Constraints.ConstraintFactory.StartWith ( string  expected)
inline

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

StartsWithConstraint NUnit.Framework.Constraints.ConstraintFactory.StartsWith ( string  expected)
inline

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

StartsWithConstraint NUnit.Framework.Constraints.ConstraintFactory.StringStarting ( string  expected)
inline

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

StartsWithConstraint NUnit.Framework.Constraints.ConstraintFactory.DoesNotStartWith ( string  expected)
inline

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

References NUnit.Framework.Constraints.ConstraintExpression.Not, and NUnit.Framework.Constraints.ConstraintExpression.StartsWith().

EndsWithConstraint NUnit.Framework.Constraints.ConstraintFactory.EndWith ( string  expected)
inline

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

EndsWithConstraint NUnit.Framework.Constraints.ConstraintFactory.EndsWith ( string  expected)
inline

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

EndsWithConstraint NUnit.Framework.Constraints.ConstraintFactory.StringEnding ( string  expected)
inline

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

EndsWithConstraint NUnit.Framework.Constraints.ConstraintFactory.DoesNotEndWith ( string  expected)
inline

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

References NUnit.Framework.Constraints.ConstraintExpression.EndsWith(), and NUnit.Framework.Constraints.ConstraintExpression.Not.

RegexConstraint NUnit.Framework.Constraints.ConstraintFactory.Match ( string  pattern)
inline

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

RegexConstraint NUnit.Framework.Constraints.ConstraintFactory.Matches ( string  pattern)
inline

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

RegexConstraint NUnit.Framework.Constraints.ConstraintFactory.StringMatching ( string  pattern)
inline

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

RegexConstraint NUnit.Framework.Constraints.ConstraintFactory.DoesNotMatch ( string  pattern)
inline

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

References NUnit.Framework.Constraints.ConstraintExpression.Matches(), and NUnit.Framework.Constraints.ConstraintExpression.Not.

SamePathConstraint NUnit.Framework.Constraints.ConstraintFactory.SamePath ( string  expected)
inline

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

SubPathConstraint NUnit.Framework.Constraints.ConstraintFactory.SubPathOf ( string  expected)
inline

Returns a constraint that tests whether the path provided is a subpath of the expected path after canonicalization.

SamePathOrUnderConstraint NUnit.Framework.Constraints.ConstraintFactory.SamePathOrUnder ( string  expected)
inline

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

RangeConstraint NUnit.Framework.Constraints.ConstraintFactory.InRange ( IComparable  from,
IComparable  to 
)
inline

Returns a constraint that tests whether the actual value falls within a specified range.

Property Documentation

ConstraintExpression NUnit.Framework.Constraints.ConstraintFactory.Not
get

Returns a ConstraintExpression that negates any following constraint.

ConstraintExpression NUnit.Framework.Constraints.ConstraintFactory.No
get

Returns a ConstraintExpression that negates any following constraint.

ConstraintExpression NUnit.Framework.Constraints.ConstraintFactory.All
get

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

ConstraintExpression NUnit.Framework.Constraints.ConstraintFactory.Some
get

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

ConstraintExpression NUnit.Framework.Constraints.ConstraintFactory.None
get

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

ResolvableConstraintExpression NUnit.Framework.Constraints.ConstraintFactory.Length
get

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

ResolvableConstraintExpression NUnit.Framework.Constraints.ConstraintFactory.Count
get

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

ResolvableConstraintExpression NUnit.Framework.Constraints.ConstraintFactory.Message
get

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

ResolvableConstraintExpression NUnit.Framework.Constraints.ConstraintFactory.InnerException
get

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

NullConstraint NUnit.Framework.Constraints.ConstraintFactory.Null
get

Returns a constraint that tests for null

TrueConstraint NUnit.Framework.Constraints.ConstraintFactory.True
get

Returns a constraint that tests for True

FalseConstraint NUnit.Framework.Constraints.ConstraintFactory.False
get

Returns a constraint that tests for False

GreaterThanConstraint NUnit.Framework.Constraints.ConstraintFactory.Positive
get

Returns a constraint that tests for a positive value

LessThanConstraint NUnit.Framework.Constraints.ConstraintFactory.Negative
get

Returns a constraint that tests for a negative value

NaNConstraint NUnit.Framework.Constraints.ConstraintFactory.NaN
get

Returns a constraint that tests for NaN

EmptyConstraint NUnit.Framework.Constraints.ConstraintFactory.Empty
get

Returns a constraint that tests for empty

UniqueItemsConstraint NUnit.Framework.Constraints.ConstraintFactory.Unique
get

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

BinarySerializableConstraint NUnit.Framework.Constraints.ConstraintFactory.BinarySerializable
get

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

XmlSerializableConstraint NUnit.Framework.Constraints.ConstraintFactory.XmlSerializable
get

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

CollectionOrderedConstraint NUnit.Framework.Constraints.ConstraintFactory.Ordered
get

Returns a constraint that tests whether a collection is ordered


The documentation for this class was generated from the following file: