storeValueWhen
类: matlab.mock.TestCase
命名空间: matlab.mock
设置属性时存储值
语法
storeValueWhen(testcase,behavior)
说明
输入参数
示例
备选方法
使用 storeValueWhen
方法在功能上等同于对 PropertySetBehavior
类的 when
方法使用 matlab.mock.actions.StoreValue
动作。例如,以下代码块在功能上是等效的。
% Using the storeValueWhen method testCase.storeValueWhen(set(behavior.PropertyFoo)); % Using the StoreValue action with the when function import matlab.mock.actions.StoreValue; when(set(behavior.PropertyFoo),StoreValue);
StoreValue
动作时,会有更多功能。例如,您可以为相同的模拟对象交互指定不同的后续行为。版本历史记录
在 R2017a 中推出