<PackageReference Include="NUnit" Version="4.4.0-beta.2.1" />

NUnit.Framework.Constraints.ConstraintExpression

public class ConstraintExpression
protected readonly ConstraintBuilder builder

public ConstraintExpression All { get; }

public DefaultConstraint Default { get; }

public EmptyConstraint Empty { get; }

public MultipleOfConstraint Even { get; }

public Constraint Exist { get; }

public FalseConstraint False { get; }

public NaNConstraint NaN { get; }

public LessThanConstraint Negative { get; }

public ConstraintExpression No { get; }

public ConstraintExpression None { get; }

public ConstraintExpression Not { get; }

public NullConstraint Null { get; }

public MultipleOfConstraint Odd { get; }

public ConstraintExpression Some { get; }

public TrueConstraint True { get; }

public UniqueItemsConstraint Unique { get; }

public ConstraintExpression With { get; }

public EqualConstraint Zero { get; }

public AnyOfConstraint AnyOf(object[] expected)

Appends an operator to the expression and returns the resulting expression itself.

Appends a self-resolving operator to the expression and returns a new ResolvableConstraintExpression.

public Constraint Append(Constraint constraint)

Appends a constraint to the expression and returns that constraint, which is associated with the current state of the expression being built. Note that the constraint is not reduced at this time. For example, if there is a NotOperator on the stack we don't reduce and return a NotConstraint. The original constraint must be returned because it may support modifiers that are yet to be applied.

public T Append<T>(T constraint) where T : Constraint

Appends a constraint to the expression and returns that constraint, which is associated with the current state of the expression being built. Note that the constraint is not reduced at this time. For example, if there is a NotOperator on the stack we don't reduce and return a NotConstraint. The original constraint must be returned because it may support modifiers that are yet to be applied.

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.

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.

public GreaterThanOrEqualConstraint AtLeast(object expected)

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

public LessThanOrEqualConstraint AtMost(object expected)

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

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

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

public SomeItemsConstraint Contain(object expected)

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

public SomeItemsConstraint<T> Contain<T>(T expected)

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

public ContainsConstraint Contain(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.

Returns a new DictionaryContainsKeyConstraint checking for the presence of a particular key in the Dictionary key collection.

public SomeItemsConstraint Contains(object expected)

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

To search for a substring instead of a collection element, use the Contains overload.

public SomeItemsConstraint<T> Contains<T>(T expected)

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

To search for a substring instead of a collection element, use the Contains overload.

public 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.

To search for a collection element instead of a substring, use the Contains overload.

Returns a new DictionaryContainsValueConstraint checking for the presence of a particular value in the Dictionary value collection.

public EndsWithConstraint EndsWith(string expected)

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

public EndsWithConstraint EndWith(string expected)

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

public EqualConstraint EqualTo(object expected)

Returns a constraint that tests two items for equality

public EqualConstraint<T> EqualTo<T>(T expected)

Returns a constraint that tests two items for equality

public EqualStringConstraint EqualTo(string expected)

Returns a constraint that tests two strings for equality

Returns a constraint that tests two date time offset instances for equality

Returns a constraint that tests two date time instances for equality

Returns a constraint that tests two timespan instances for equality

public EqualNumericConstraint<double> EqualTo(double expected)

Returns a constraint that tests two numbers for equality

public EqualNumericConstraint<float> EqualTo(float expected)

Returns a constraint that tests two numbers for equality

public EqualNumericConstraint<decimal> EqualTo(decimal expected)

Returns a constraint that tests two numbers for equality

public EqualNumericConstraint<long> EqualTo(long expected)

Returns a constraint that tests two numbers for equality

public EqualNumericConstraint<int> EqualTo(int expected)

Returns a constraint that tests two numbers for equality

public EqualNumericConstraint<short> EqualTo(short expected)

Returns a constraint that tests two numbers for equality

public EqualNumericConstraint<byte> EqualTo(byte expected)

Returns a constraint that tests two numbers for equality

public EqualNumericConstraint<ulong> EqualTo(ulong expected)

Returns a constraint that tests two numbers for equality

public EqualNumericConstraint<uint> EqualTo(uint expected)

Returns a constraint that tests two numbers for equality

public EqualNumericConstraint<ushort> EqualTo(ushort expected)

Returns a constraint that tests two numbers for equality

public EqualNumericConstraint<sbyte> EqualTo(sbyte expected)

Returns a constraint that tests two numbers for equality

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

public ItemsConstraintExpression 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.

public GreaterThanConstraint GreaterThan(object expected)

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

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

public RangeConstraint InRange(object from, object to)

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

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.

public ConstraintExpression ItemAt(object[] indexArgs)

Returns a new IndexerConstraintExpression, which will apply any following constraint to that indexer value.

public LessThanConstraint LessThan(object expected)

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

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

public RegexConstraint Match(string pattern)

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

public RegexConstraint Match(Regex regex)

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

Returns the constraint provided as an argument - used to allow custom custom constraints to easily participate in the syntax.

public Constraint Matches<TActual>(Predicate<TActual> predicate)

Returns the constraint provided as an argument - used to allow custom custom constraints to easily participate in the syntax.

public RegexConstraint Matches(string pattern)

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

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

public SomeItemsConstraint Member(object expected)

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

public SomeItemsConstraint<T> Member<T>(T expected)

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

public MultipleOfConstraint MultipleOf(int multiple)

Returns a constraint that tests for a number to be a multiple of another.

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.

public SameAsConstraint SameAs(object expected)

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

public SamePathConstraint SamePath(string expected)

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

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

public StartsWithConstraint StartsWith(string expected)

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

public StartsWithConstraint StartWith(string expected)

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

public SubPathConstraint SubPathOf(string expected)

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

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

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

public ExactTypeConstraint TypeOf(Type expectedType)

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

public ExactTypeConstraint TypeOf<TExpected>()

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