Search Results for

    Show / Hide Table of Contents

    Class DelayedConstraint

    Applies a delay to the match so that a match can be evaluated in the future.

    Inheritance
    object
    Constraint
    PrefixConstraint
    DelayedConstraint
    DelayedConstraint.WithDimensionedDelayInterval
    DelayedConstraint.WithRawDelayInterval
    DelayedConstraint.WithRawPollingInterval
    Implements
    IConstraint
    IResolveConstraint
    Inherited Members
    PrefixConstraint.BaseConstraint
    PrefixConstraint.DescriptionPrefix
    Constraint.GetTestObject<TActual>(ActualValueDelegate<TActual>)
    Constraint.ToString()
    Constraint.GetStringRepresentation(IEnumerable)
    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 DelayedConstraint : PrefixConstraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    DelayedConstraint(IConstraint, int)

    Creates a new DelayedConstraint

    Declaration
    public DelayedConstraint(IConstraint baseConstraint, int delayInMilliseconds)
    Parameters
    Type Name Description
    IConstraint baseConstraint

    The inner constraint to decorate

    int delayInMilliseconds

    The time interval after which the match is performed

    Exceptions
    Type Condition
    InvalidOperationException

    If the value of delayInMilliseconds is less than 0

    View Source

    DelayedConstraint(IConstraint, int, int)

    Creates a new DelayedConstraint

    Declaration
    public DelayedConstraint(IConstraint baseConstraint, int delayInMilliseconds, int pollingIntervalInMilliseconds)
    Parameters
    Type Name Description
    IConstraint baseConstraint

    The inner constraint to decorate

    int delayInMilliseconds

    The time interval after which the match is performed, in milliseconds

    int pollingIntervalInMilliseconds

    The time interval used for polling, in milliseconds

    Exceptions
    Type Condition
    InvalidOperationException

    If the value of delayInMilliseconds is less than 0

    Properties

    View Source

    DelayInterval

    Delay value store as an Interval object

    Declaration
    protected Interval DelayInterval { get; set; }
    Property Value
    Type Description
    Interval
    View Source

    Description

    Gets text describing a constraint

    Declaration
    public override string Description { get; }
    Property Value
    Type Description
    string
    Overrides
    PrefixConstraint.Description
    View Source

    PollingInterval

    Polling value stored as an Interval object

    Declaration
    protected Interval PollingInterval { get; set; }
    Property Value
    Type Description
    Interval

    Methods

    View Source

    ApplyToAsync<TActual>(Func<Task<TActual>>)

    Applies the constraint to a delegate that returns the task. The default implementation simply evaluates the delegate and awaits the task but derived classes may override it to provide for delayed processing.

    Declaration
    public override Task<ConstraintResult> ApplyToAsync<TActual>(Func<Task<TActual>> taskDel)
    Parameters
    Type Name Description
    Func<Task<TActual>> taskDel
    Returns
    Type Description
    Task<ConstraintResult>
    Type Parameters
    Name Description
    TActual
    Overrides
    Constraint.ApplyToAsync<TActual>(Func<Task<TActual>>)
    View Source

    ApplyTo<TActual>(ActualValueDelegate<TActual>)

    Test whether the constraint is satisfied by a delegate

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

    The delegate whose value is to be tested

    Returns
    Type Description
    ConstraintResult

    A ConstraintResult

    Type Parameters
    Name Description
    TActual
    Overrides
    Constraint.ApplyTo<TActual>(ActualValueDelegate<TActual>)
    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 if the base constraint fails, false if it succeeds

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

    ApplyTo<TActual>(ref TActual)

    Test whether the constraint is satisfied by a given reference. Overridden to wait for the specified delay period before calling the base constraint with the dereferenced value.

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

    A reference to the value to be tested

    Returns
    Type Description
    ConstraintResult

    True for success, false for failure

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

    GetStringRepresentation()

    Returns the string representation of the constraint.

    Declaration
    protected override string GetStringRepresentation()
    Returns
    Type Description
    string
    Overrides
    Constraint.GetStringRepresentation()

    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