matlab.mock.InteractionHistory.forMock
Class:matlab.mock.InteractionHistory
Package:matlab.mock
Return history from mock object
Description
history = matlab.mock.InteractionHistory.forMock(
returns the history from a mock object.mock
)history
is an array ofmatlab.mock.InteractionHistory
objects. Each element inhistory
corresponds to one method call, property access, or property modification. The array elements are ordered, with the first element indicating the first recorded interaction. This method returns interactions with publicly visible methods and properties only. For example, the following interactions are not recorded:
Calls to
Hidden
methodsCalls to
Sealed
superclass methodsAccesses or modifications of concrete superclass properties
Input Arguments
Examples
Alternatives
You can obtain the same history of interactions using thegetMockHistory
method on amatlab.mock.TestCase
实例。For example, if you have amatlab.mock.TestCase
instancetc
, and a mock objectmock
, the following method calls are equivalent.
h = matlab.mock.InteractionHistory.forMock(模拟);h = tc.getMockHistory(mock);
However, you do not need access to thematlab.mock.TestCase
instance to use theforMock
method.