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

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 Default { get; }

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 Exact { get; }

Returns an empty Tolerance object, equivalent to specifying an exact match even if DefaultFloatingPointTolerance is set.

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 IsUnsetOrDefault { get; }

Returns true if the current tolerance has not been set or is using the .

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 specified amount