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.
Inherited Members
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 SourceEqualTimeBasedConstraintWithNumericTolerance(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 |
| double | tolerance | The tolerance to apply when qualified with a unit. |
Properties
View SourceBuilder
The ConstraintBuilder holding this constraint
Declaration
public ConstraintBuilder? Builder { get; set; }
Property Value
| Type | Description |
|---|---|
| ConstraintBuilder |
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 |
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 |
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 |
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 |
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 |
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 |