matlab.mock.PropertySetBehavior Class
Namespace: matlab.mock
Specify mock object set behavior
Description
Use the PropertySetBehavior
class to specify
mock object set behavior. There are several ways to specify property
set behavior.
Pass a mock object action, such as
matlab.mock.actions.StoreValue
, to thewhen
method.Pass a
PropertySetBehavior
object to a method of thematlab.mock.TestCase
class, such asstoreValueWhen
.
To qualify mock property interactions, see matlab.mock.PropertyBehavior
.
Construction
The mocking framework creates a PropertySetBehavior
instance when you call the
set
or setToValue
method. Typically, you construct the
PropertySetBehavior
implicitly. For example,
testCase.throwExceptionWhen(set(behavior.MyProperty))
.
Methods
when | Specify mock object property set action |
Copy Semantics
Value. To learn how value classes affect copy operations, see Copying Objects.
Version History
Introduced in R2017a