Search Results for

    Show / Hide Table of Contents

    Class RangeConstraint

    RangeConstraint tests whether two values are within a specified range.

    Inheritance
    object
    Constraint
    RangeConstraint
    Implements
    IConstraint
    IResolveConstraint
    Inherited Members
    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 RangeConstraint : Constraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    RangeConstraint(object, object)

    Initializes a new instance of the RangeConstraint class.

    Declaration
    public RangeConstraint(object from, object to)
    Parameters
    Type Name Description
    object from

    Inclusive beginning of the range.

    object to

    Inclusive end of the range.

    Properties

    View Source

    Description

    Gets text describing a constraint

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

    Methods

    View Source

    ApplyTo<TActual>(TActual)

    Test whether the constraint is satisfied by a given value

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

    The value to be tested

    Returns
    Type Description
    ConstraintResult

    True for success, false for failure

    Type Parameters
    Name Description
    TActual
    Overrides
    Constraint.ApplyTo<TActual>(TActual)
    View Source

    Using(IComparer)

    Modifies the constraint to use an IComparer and returns self.

    Declaration
    public RangeConstraint Using(IComparer comparer)
    Parameters
    Type Name Description
    IComparer comparer
    Returns
    Type Description
    RangeConstraint
    View Source

    Using<T>(IComparer<T>)

    Modifies the constraint to use an IComparer<T> and returns self.

    Declaration
    public RangeConstraint Using<T>(IComparer<T> comparer)
    Parameters
    Type Name Description
    IComparer<T> comparer
    Returns
    Type Description
    RangeConstraint
    Type Parameters
    Name Description
    T
    View Source

    Using<T>(Comparison<T>)

    Modifies the constraint to use a Comparison<T> and returns self.

    Declaration
    public RangeConstraint Using<T>(Comparison<T> comparer)
    Parameters
    Type Name Description
    Comparison<T> comparer
    Returns
    Type Description
    RangeConstraint
    Type Parameters
    Name Description
    T

    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