matlab.mock.PropertyBehavior Class
Namespace: matlab.mock
Specify mock object property behavior and qualify interactions
Description
Use the PropertyBehavior class to specify mock
object property behavior and qualify interactions.
There are several ways to qualify interactions with mock object properties.
Pass the
PropertyBehaviorinstance to a method of thematlab.mock.TestCase, such asverifyAccessedorassumeNotSet.Pass the
PropertyBehaviorinstance and a mock object constraint, such asmatlab.mock.constraints.WasAccessed, to theverifyThat,assertThat,fatalAssertThat, orassumeThatmethod of thematlab.unittest.TestCaseclass.
To define behavior for a mock object property, you first need
a PropertyGetBehavior or PropertySetBehavior instance.
To create one of these instances, call a PropertyBehavior method.
For more information on defining property behavior, see matlab.mock.PropertyGetBehavior or matlab.mock.PropertySetBehavior.
Construction
The mocking framework constructs a PropertyBehavior instance
when you access a property on the mock behavior object.
Methods
| get | Construct object to define mock property get behavior |
| set | Construct object to define mock property set behavior |
| setToValue | Construct object to define behavior when mocked property is set to specific value |
Copy Semantics
Value. To learn how value classes affect copy operations, see Copying Objects.
Version History
Introduced in R2017a