Table of Contents

Class CountZeroConstraint

Namespace
NUnit.Framework.Constraints
Assembly
nunit.framework.dll

CountZeroConstraint tests whether an instance has a property .Count with value zero.

public class CountZeroConstraint : Constraint, IConstraint, IResolveConstraint
Inheritance
CountZeroConstraint
Implements
Inherited Members

Constructors

CountZeroConstraint()

public CountZeroConstraint()

Properties

Description

The Description of what this constraint tests, for use in messages and in the ConstraintResult.

public override string Description { get; }

Property Value

string

Methods

ApplyTo<TActual>(TActual)

Test whether the constraint is satisfied by a given value

public override ConstraintResult ApplyTo<TActual>(TActual actual)

Parameters

actual TActual

The value to be tested

Returns

ConstraintResult

True for success, false for failure

Type Parameters

TActual

HasCountProperty(Type)

Checks if the specified type has a int Count property.

public static bool HasCountProperty(Type type)

Parameters

type Type

Type to check.

Returns

bool

true when type has a 'int Count' property, false otherwise.