matlab.unittest.constraints.EveryElementOf Class
Namespace: matlab.unittest.constraints
Test if every element of array satisfies constraint
Description
The matlab.unittest.constraints.EveryElementOf
class provides a proxy of
the actual value, so you can test if every element of an array satisfies a given constraint.
When you include the proxy in your test, the testing framework examines the constraint on an
element-by-element basis.
You can use an instance of this class in tests performed with the qualification methods
assertThat
, assumeThat
, fatalAssertThat
,
or verifyThat
. The class does not modify the supplied actual value. It serves
only as a wrapper to perform the constraint analysis.
Creation
Description
p = matlab.unittest.constraints.EveryElementOf(actualValue)
creates a proxy to test if every element of the specified array satisfies a constraint and
sets the ActualValue
property. When you use this proxy to test against a
constraint, the test passes if every element of actualValue
satisfies
the constraint.
Properties
Examples
Tips
You can use
EveryElementOf
to check if every element of an array satisfies a constraint. However, there are some constraints, such asIsGreaterThan
andIsLessThan
, that natively validate if every element satisfies a condition. In these situations, the use ofEveryElementOf
is unnecessary and degrades qualification performance.
Version History
Introduced in R2013a