<PackageReference Include="NUnit" Version="2.7.1" />

Tolerance

public class Tolerance
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 static Tolerance Empty { get; }

Returns an empty Tolerance object, equivalent to specifying no tolerance. In most cases, it results in an exact match but for floats and doubles a default tolerance may be used.

public static Tolerance Zero { get; }

Returns a zero Tolerance object, equivalent to specifying an exact match.

public Tolerance Days { get; }

Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of days.

public Tolerance Hours { get; }

Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of hours.

public bool IsEmpty { get; }

Returns true if the current tolerance is empty.

public Tolerance Milliseconds { get; }

Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of milliseconds.

public Tolerance Minutes { get; }

Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of minutes.

public ToleranceMode Mode { get; }

Gets the ToleranceMode for the current Tolerance

public Tolerance Percent { get; }

Returns a new tolerance, using the current amount as a percentage.

public Tolerance Seconds { get; }

Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of seconds.

public Tolerance Ticks { get; }

Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of clock ticks.

public Tolerance Ulps { get; }

Returns a new tolerance, using the current amount in Ulps.

public object Value { get; }

Gets the value of the current Tolerance instance.

public Tolerance(object amount)

Constructs a linear tolerance of a specdified amount