Search Results for

    Show / Hide Table of Contents

    Class AssignableFromConstraint

    AssignableFromConstraint is used to test that an object can be assigned from a given Type.

    Inheritance
    object
    Constraint
    TypeConstraint
    AssignableFromConstraint
    Implements
    IConstraint
    IResolveConstraint
    Inherited Members
    TypeConstraint.expectedType
    TypeConstraint.actualType
    TypeConstraint.ApplyTo<TActual>(TActual)
    TypeConstraint.Description
    Constraint.ApplyTo<TActual>(ActualValueDelegate<TActual>)
    Constraint.ApplyTo<TActual>(ref TActual)
    Constraint.ApplyToAsync<TActual>(Func<Task<TActual>>)
    Constraint.GetTestObject<TActual>(ActualValueDelegate<TActual>)
    Constraint.ToString()
    Constraint.GetStringRepresentation(IEnumerable)
    Constraint.GetStringRepresentation()
    Constraint.After(int)
    Constraint.After(int, int)
    Constraint.DisplayName
    Constraint.Arguments
    Constraint.Builder
    Constraint.And
    Constraint.With
    Constraint.Or
    object.GetType()
    object.MemberwiseClone()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: NUnit.Framework.Constraints
    Assembly: nunit.framework.dll
    Syntax
    public class AssignableFromConstraint : TypeConstraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    AssignableFromConstraint(Type)

    Construct an AssignableFromConstraint for the type provided

    Declaration
    public AssignableFromConstraint(Type type)
    Parameters
    Type Name Description
    Type type

    Methods

    View Source

    Matches(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.

    Overrides
    TypeConstraint.Matches(object?)

    Implements

    IConstraint
    IResolveConstraint
    • View Source
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0