getDiagnosticFor

Class: matlab.unittest.constraints.Constraint
Package: matlab.unittest.constraints

Produce diagnostic for compared value

Syntax

diag = getDiagnosticFor(constObj,actVal)

Description

diag = getDiagnosticFor(constObj,actVal) produces a diagnostic, diag, for a compared value, actVal. When creating a custom constraint, the class author must implement the getDiagnosticFor method so that it analyzes the value, actVal, against the constraint, constObj, and instantiates and returns a matlab.unittest.diagnostics.Diagnostic object.

Typically, the testing framework calls this method when it encounters a qualification failure. Therefore, the constraint author can afford to undertake a more detailed analysis in the getDiagnosticFor method than the satisfiedBy method.

Input Arguments

actVal

Value for comparison

constObj

Constraint instance

Output Arguments

diag

Diagnostic instance