CollectionConstraint 类

定义

CollectionConstraint 是在集合上运行的约束的抽象基类。

public abstract class CollectionConstraint : NUnit.Framework.Constraints.Constraint
type CollectionConstraint = class
    inherit Constraint
继承
CollectionConstraint
派生

构造函数

CollectionConstraint()

构造空的 CollectionConstraint

CollectionConstraint(Object)

构造 CollectionConstraint

字段

actual

针对约束测试的实际值

(继承自 Constraint)

属性

And

通过将 And 追加到当前约束,返回 ConstraintExpression。

(继承自 Constraint)
DisplayName

此约束的显示名称,供 ToString () 使用。 默认值是删除了尾随“Constraint”的约束的名称。 派生类可能会将其设置为其构造函数中的另一个名称。

(继承自 Constraint)
Or

通过将 Or 追加到当前约束,返回 ConstraintExpression。

(继承自 Constraint)
With

通过将 And 追加到当前约束,返回 ConstraintExpression。

(继承自 Constraint)

方法

After(Int32)

CollectionConstraint 是在集合上运行的约束的抽象基类。

(继承自 Constraint)
After(Int32, Int32)

CollectionConstraint 是在集合上运行的约束的抽象基类。

(继承自 Constraint)
doMatch(IEnumerable)

派生类要实现的受保护方法

GetStringRepresentation()

CollectionConstraint 是在集合上运行的约束的抽象基类。

(继承自 Constraint)
IsEmpty(IEnumerable)

确定指定的可枚举是否为空。

Matches(Object)

测试给定值是否满足约束

Matches<T>(ActualValueDelegate<T>)

CollectionConstraint 是在集合上运行的约束的抽象基类。

(继承自 Constraint)
Matches<T>(T)

CollectionConstraint 是在集合上运行的约束的抽象基类。

(继承自 Constraint)
ToString()

ToString 的默认替代返回约束 DisplayName,后跟尖括号内的任何参数。

(继承自 Constraint)
WriteActualValueTo(MessageWriter)

将失败约束测试的实际值写入 MessageWriter。 默认实现只是写入实际的原始值,让编写器执行任何格式设置。

(继承自 Constraint)
WriteDescriptionTo(MessageWriter)

将约束说明写入 MessageWriter

(继承自 Constraint)
WriteMessageTo(MessageWriter)

将失败消息写入作为参数提供的 MessageWriter。 默认实现只是将约束和实际值传递给编写器,然后编写器会显示约束说明和值。 需要提供其他详细信息(例如发生错误的位置)的约束可以替代此错误。

(继承自 Constraint)

显式接口实现

IResolveConstraint.Resolve()

CollectionConstraint 是在集合上运行的约束的抽象基类。

(继承自 Constraint)

适用于