matlab.mock.constraints.WasSet Class
R2026bNamespace: matlab.mock.constraints
Superclasses: matlab.unittest.constraints.BooleanConstraint
Test if mock object property was set
Description
The matlab.mock.constraints.WasSet class provides a constraint to test if a mock object
property was set. To test whether an actual value satisfies the constraint, use the constraint
with the assertThat, assumeThat,
fatalAssertThat, or verifyThat method of the matlab.mock.TestCase class.
Because the matlab.mock.constraints.WasSet class is a subclass of the matlab.unittest.constraints.BooleanConstraint class, you can create constraints
that can be combined and negated using the and (&), or
(|), and not (~) operators.
Creation
Description
c = matlab.mock.constraints.WasSet creates a constraint to test
if a mock object property was set. The constraint is satisfied by a matlab.mock.PropertyBehavior instance whose corresponding mock object property
was set at least once.
c = matlab.mock.constraints.WasSet(
specifies options using one or more name-value arguments. For example, Name=Value)c =
matlab.mock.constraints.WasSet(ToValue=42,WithCount=3) creates a constraint
that is satisfied if a property is set to 42 exactly 3 times.
Name-Value Arguments
Properties
Examples
Version History
Introduced in R2017a