matlab.mock.actions.ReturnStoredValue class
Package: matlab.mock.actions
Return stored property value
Description
The ReturnStoredValue
action specifies that the
stored value is returned when accessing a property.
By default, when you access property values in strict mocks, MATLAB® throws
an exception. To specify that the framework returns the stored value
of a mock object property, use the ReturnStoredValue
class.
Construction
action = ReturnStoredValue
returns the
stored property value.
Methods
repeat | Repeat returning stored property value |
then | Action for mock object interaction or action subsequent to returning stored property value |
Copy Semantics
Value. To learn how value classes affect copy operations, see Copying Objects.
Examples
Alternatives
For a simple directive to return property values, you can use
the returnStoredValueWhen
method
of the matlab.mock.TestCase
class. However, there is
more functionality when you use the ReturnStoredValue
action.