Specify mock object method behavior and qualify method calls
MethodCallBehavior object to specify
behavior for a mock object method and to qualify method calls.
There are several ways to define behavior for a mock object method.
Pass a mock object action, such as
matlab.mock.actions.AssignOutputs, to the
whenmethod of the
MethodCallBehaviorobject to a method of the
matlab.mock.TestCaseclass, such as
There are several ways to qualify interactions with the mock object method.
The mocking framework constructs a
when you call a method of the mock behavior object.
|when||Specify mock object method behavior|
|withAnyInputs||Specify mock object method call with any number of inputs with any value|
|withExactInputs||Specify mock object method call with only object as input|
|withNargout||Specify mock object method call with defined number of output arguments|
Value. To learn how value classes affect copy operations, see Copying Objects.