Search Results for

    Show / Hide Table of Contents

    Class ExactTypeConstraint

    ExactTypeConstraint is used to test that an object is of the exact type provided in the constructor

    Inheritance
    object
    Constraint
    TypeConstraint
    ExactTypeConstraint
    ExceptionTypeConstraint
    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.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 ExactTypeConstraint : TypeConstraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    ExactTypeConstraint(Type)

    Construct an ExactTypeConstraint for a given Type

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

    The expected Type.

    Properties

    View Source

    DisplayName

    The display name of this Constraint for use by ToString(). The default value is the name of the constraint with trailing "Constraint" removed. Derived classes may set this to another name in their constructors.

    Declaration
    public override string DisplayName { get; }
    Property Value
    Type Description
    string
    Overrides
    Constraint.DisplayName

    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