Class Tolerance
- Namespace
- NUnit.Framework.Constraints
- Assembly
- nunit.framework.dll
The Tolerance class generalizes the notion of a tolerance within which an equality test succeeds. Normally, it is used with numeric types, but it can be used with any type that supports taking a difference between two objects and comparing that difference to a value.
public class Tolerance
- Inheritance
-
Tolerance
- Inherited Members
Constructors
Tolerance(object)
Constructs a linear tolerance of a specified amount
public Tolerance(object amount)
Parameters
amount
object
Properties
Days
Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of days.
public Tolerance Days { get; }
Property Value
Default
Returns a default Tolerance object, equivalent to specifying an exact match unless DefaultFloatingPointTolerance is set, in which case, the DefaultFloatingPointTolerance will be used.
public static Tolerance Default { get; }
Property Value
Exact
Returns an empty Tolerance object, equivalent to specifying an exact match even if DefaultFloatingPointTolerance is set.
public static Tolerance Exact { get; }
Property Value
Hours
Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of hours.
public Tolerance Hours { get; }
Property Value
IsUnsetOrDefault
Returns true if the current tolerance has not been set or is using the .
public bool IsUnsetOrDefault { get; }
Property Value
Milliseconds
Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of milliseconds.
public Tolerance Milliseconds { get; }
Property Value
Minutes
Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of minutes.
public Tolerance Minutes { get; }
Property Value
Mode
Gets the ToleranceMode for the current Tolerance
public ToleranceMode Mode { get; }
Property Value
Percent
Returns a new tolerance, using the current amount as a percentage.
public Tolerance Percent { get; }
Property Value
Seconds
Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of seconds.
public Tolerance Seconds { get; }
Property Value
Ticks
Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of clock ticks.
public Tolerance Ticks { get; }
Property Value
Ulps
Returns a new tolerance, using the current amount in Ulps
public Tolerance Ulps { get; }
Property Value
Value
Gets the value of the current Tolerance instance.
public object Value { get; }