Verifies that an actual value does not approximately equal some unexpected value to within a specified delta.

Namespace:  MbUnit.Framework
Assembly:  MbUnit (in MbUnit.dll) Version: 3.3.0.0 (3.3.610.0)

Syntax

C#
public static void AreNotApproximatelyEqual<TValue, TDifference>(
	TValue unexpectedValue,
	TValue actualValue,
	TDifference delta,
	string messageFormat,
	params Object[] messageArgs
)
Visual Basic (Declaration)
Public Shared Sub AreNotApproximatelyEqual(Of TValue, TDifference) ( _
	unexpectedValue As TValue, _
	actualValue As TValue, _
	delta As TDifference, _
	messageFormat As String, _
	ParamArray messageArgs As Object() _
)

Parameters

unexpectedValue
Type: TValue
The expected value.
actualValue
Type: TValue
The actual value.
delta
Type: TDifference
The inclusive delta between the values.
messageFormat
Type: System..::.String
The custom assertion message format, or null if none.
messageArgs
Type: array< System..::.Object >[]()[]
The custom assertion message arguments, or null if none.

Type Parameters

TValue
The type of values to be compared.
TDifference
The type of the difference produced when the values are subtracted, for numeric types this is the same as TValue but it may differ for other types.

Remarks

The values are considered approximately equal if the absolute value of their difference is less than or equal to the delta.

This method works with any comparable type that also supports a subtraction operator including Single, Double, Decimal, Int32, DateTime (using a TimeSpan delta), and many others.

Exceptions

ExceptionCondition
Gallio.Framework.Assertions..::.AssertionExceptionThrown if the verification failed unless the current AssertionFailureBehavior indicates otherwise.

See Also