Class AssignableToConstraint
AssignableToConstraint is used to test that an object can be assigned to a given Type.
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public class AssignableToConstraint : TypeConstraint, IConstraint, IResolveConstraint
Constructors
View SourceAssignableToConstraint(Type)
Construct an AssignableToConstraint for the type provided
Declaration
public AssignableToConstraint(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type |
Methods
View SourceMatches(object?)
Apply the constraint to an actual value, returning true if it succeeds
Declaration
protected override bool Matches(object? actual)
Parameters
Type | Name | Description |
---|---|---|
object | actual | The actual argument |
Returns
Type | Description |
---|---|
bool | True if the constraint succeeds, otherwise false. |