matlab.mock.actions.ReturnStoredValue class
Package:matlab.mock.actions
Return stored property value
Description
TheReturnStoredValue
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 theReturnStoredValue
class.
Construction
action = ReturnStoredValue
返回存储属性值。
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, seeCopying Objects.
Examples
Alternatives
For a simple directive to return property values, you can use thereturnStoredValueWhen
method of thematlab.mock.TestCase
class. However, there is more functionality when you use theReturnStoredValue
action.