getDiagnosticFor

Class: matlab.unittest.constraints.Tolerance
Package: matlab.unittest.constraints

Produce diagnostic for two values specified to be within tolerance

Syntax

diag = getDiagnosticFor(tolObj,actVal,expVal)

Description

diag = getDiagnosticFor(tolObj,actVal,expVal) produces a diagnostic, diag, for a value, actVal, evaluated against another value, expVal, within the tolerance defined by tolObj. When creating a custom tolerance, the class author must implement the getDiagnosticFor method so that it analyzes the two values, actVal and expVal, against the tolerance, tolObj, and instantiates and returns a matlab.unittest.diagnostics.Diagnostic object.

Typically, this diagnostic is used when the getDiagnosticFor method of IsEqualTo is invoked, and the result is incorporated into the diagnostic output of the IsEqualTo constraint.

Input Arguments

actVal

Value to determine if is within tolerance of expVal

tolObj

Tolerance instance

expVal

Expected value