Available Tests
Each modddel's tester has 3 kinds of tests available :
"isValid" tests
The tester has a method named isValid
. It checks that the modddel, when instantiated with the given parameters, is valid .
"isSanitized" tests
The tester has a method named isSanitized
. It checks that the modddel, when instantiated with the given parameters, holds the sanitizedParams
(See the sanitization section).
"isInvalid" tests
For each validationStep, the tester has a matching isInvalid
method (Ex : if a validationStep is named "Value", the method will be isInvalidValue
).
It tests that the modddel, when instantiated with the given parameters, is an instance of the invalid-step union-case matching the validationStep, and holds the given failures.
For example :
Another example where the validationStep contains the contentValidation :
Note that the order of the ModddelInvalidMember
s doesn't matter here (behind the scenes, the unorderedEquals
matcher is used for comparing the modddel's contentFailure with the provided one). For more information about ContentFailure
and ModddelInvalidMember
, read this section.
Like for the Modddel, the dependency parameters are not taken into account for equality in ModddelParams, and are not included in the toString
output of the ModddelParams.
Last updated