Search Results for

    Show / Hide Table of Contents

    Interface IConstraint

    Interface for all constraints

    Inherited Members
    IResolveConstraint.Resolve()
    Namespace: NUnit.Framework.Constraints
    Assembly: nunit.framework.dll
    Syntax
    public interface IConstraint : IResolveConstraint

    Properties

    View Source

    Arguments

    Arguments provided to this Constraint, for use in formatting the description.

    Declaration
    object?[] Arguments { get; }
    Property Value
    Type Description
    object[]
    View Source

    Builder

    The ConstraintBuilder holding this constraint

    Declaration
    ConstraintBuilder? Builder { get; set; }
    Property Value
    Type Description
    ConstraintBuilder
    View Source

    Description

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

    Declaration
    string Description { get; }
    Property Value
    Type Description
    string
    View Source

    DisplayName

    The display name of this Constraint for use by ToString().

    Declaration
    string DisplayName { get; }
    Property Value
    Type Description
    string

    Methods

    View Source

    ApplyTo<TActual>(ActualValueDelegate<TActual>)

    Applies the constraint to an ActualValueDelegate that returns the value to be tested. The default implementation simply evaluates the delegate but derived classes may override it to provide for delayed processing.

    Declaration
    ConstraintResult ApplyTo<TActual>(ActualValueDelegate<TActual> del)
    Parameters
    Type Name Description
    ActualValueDelegate<TActual> del

    An ActualValueDelegate

    Returns
    Type Description
    ConstraintResult

    A ConstraintResult

    Type Parameters
    Name Description
    TActual
    View Source

    ApplyTo<TActual>(TActual)

    Applies the constraint to an actual value, returning a ConstraintResult.

    Declaration
    ConstraintResult ApplyTo<TActual>(TActual actual)
    Parameters
    Type Name Description
    TActual actual

    The value to be tested

    Returns
    Type Description
    ConstraintResult

    A ConstraintResult

    Type Parameters
    Name Description
    TActual
    View Source

    ApplyTo<TActual>(ref TActual)

    Test whether the constraint is satisfied by a given reference. The default implementation simply dereferences the value but derived classes may override it to provide for delayed processing.

    Declaration
    ConstraintResult ApplyTo<TActual>(ref TActual actual)
    Parameters
    Type Name Description
    TActual actual

    A reference to the value to be tested

    Returns
    Type Description
    ConstraintResult

    A ConstraintResult

    Type Parameters
    Name Description
    TActual
    • 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