Package: matlab.unittest.constraints
Test if all elements of array meet constraint
The EveryElementOf
class creates a proxy of the
actual value to the framework. The proxy enables a test writer to
apply a constraint against each element of an array, which ensures
that a passing result occurs when every element of the array that
satisfies the constraint.
It is intended that you use this class through matlab.unittest
qualifications
as shown in the examples. The class does not modify the provided actual
value, but serves as a wrapper to perform the constraint analysis.
The testing framework analyzes the constraint on an element-by-element
basis.
EveryElementOf(
creates
a proxy instance that tests if every element of a provided array, actVal
)actVal
,
meets a constraint. The test passes if all elements satisfy the constraint.
EveryElementOf
checks if every element
in the provided array satisfies an associated constraint. However,
there are some constraints, such as IsEqualTo
and IsGreaterThan
, IsLessThan
,
that natively validate if all elements in the array satisfy a condition.
In these situations, use of EveryElementOf
is unnecessary
and impedes qualification performance.
|
Actual value to test against constraint |
|
Actual value to test against constraint. Set this property through
the constructor via the |
Value. To learn how value classes affect copy operations, see Copying Objects.
AnyCellOf
| AnyElementOf
| EveryCellOf
| matlab.unittest.qualifications