getMockHistory
Class: matlab.mock.TestCase
Namespace: matlab.mock
Return history of mock object interactions
Description
history = getMockHistory(
returns the history from a mock object. testcase
,mock
)history
is an array of matlab.mock.InteractionHistory
objects. Each element in history
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 the matlab.mock.InteractionHistory.forMock
method. For example, if you have a matlab.mock.TestCase
instance tc
, and a mock object mock
, the following method calls are equivalent.
h = matlab.mock.InteractionHistory.forMock(mock); h = tc.getMockHistory(mock);
However, you do not need access to the matlab.mock.TestCase
instance to use the matlab.mock.InteractionHistory.forMock
method.
Version History
Introduced in R2018a