Search Results for

    Show / Hide Table of Contents

    Class EqualTimeBasedConstraintWithNumericTolerance<T>

    EqualConstraint is able to compare an actual value with the expected value provided in its constructor. Two objects are considered equal if both are null, or if both have the same value. NUnit has special semantics for some object types.

    Inheritance
    object
    EqualTimeBasedConstraintWithNumericTolerance<T>
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: NUnit.Framework.Constraints
    Assembly: nunit.framework.dll
    Syntax
    public class EqualTimeBasedConstraintWithNumericTolerance<T> where T : notnull, IEquatable<T>, IComparable<T>
    Type Parameters
    Name Description
    T

    Constructors

    View Source

    EqualTimeBasedConstraintWithNumericTolerance(T, Func<T, long>, double)

    Initializes a new instance of the EqualConstraint class.

    Declaration
    public EqualTimeBasedConstraintWithNumericTolerance(T expected, Func<T, long> getTicks, double tolerance)
    Parameters
    Type Name Description
    T expected

    The expected value.

    Func<T, long> getTicks

    Method to extract the Ticks from an instance of T.

    double tolerance

    The tolerance to apply when qualified with a unit.

    Properties

    View Source

    Builder

    The ConstraintBuilder holding this constraint

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

    Days

    Causes the tolerance to be interpreted as a TimeSpan in days.

    Declaration
    public EqualTimeBasedConstraintWithTimeSpanTolerance<T> Days { get; }
    Property Value
    Type Description
    EqualTimeBasedConstraintWithTimeSpanTolerance<T>

    Self

    View Source

    Hours

    Causes the tolerance to be interpreted as a TimeSpan in hours.

    Declaration
    public EqualTimeBasedConstraintWithTimeSpanTolerance<T> Hours { get; }
    Property Value
    Type Description
    EqualTimeBasedConstraintWithTimeSpanTolerance<T>

    Self

    View Source

    Milliseconds

    Causes the tolerance to be interpreted as a TimeSpan in milliseconds.

    Declaration
    public EqualTimeBasedConstraintWithTimeSpanTolerance<T> Milliseconds { get; }
    Property Value
    Type Description
    EqualTimeBasedConstraintWithTimeSpanTolerance<T>

    Self

    View Source

    Minutes

    Causes the tolerance to be interpreted as a TimeSpan in minutes.

    Declaration
    public EqualTimeBasedConstraintWithTimeSpanTolerance<T> Minutes { get; }
    Property Value
    Type Description
    EqualTimeBasedConstraintWithTimeSpanTolerance<T>

    Self

    View Source

    Seconds

    Causes the tolerance to be interpreted as a TimeSpan in seconds.

    Declaration
    public EqualTimeBasedConstraintWithTimeSpanTolerance<T> Seconds { get; }
    Property Value
    Type Description
    EqualTimeBasedConstraintWithTimeSpanTolerance<T>

    Self

    View Source

    Ticks

    Causes the tolerance to be interpreted as a TimeSpan in clock ticks.

    Declaration
    public EqualTimeBasedConstraintWithTimeSpanTolerance<T> Ticks { get; }
    Property Value
    Type Description
    EqualTimeBasedConstraintWithTimeSpanTolerance<T>

    Self

    • 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