%% Assign Series of Outputs to Mock
% Create a strict mock for a bank account class.

testCase = matlab.mock.TestCase.forInteractiveUse;
[mock,behavior] = testCase.createMock('AddedProperties',"isOpen",'Strict',true);

% Set up behavior to return empty once and then true.

import matlab.mock.actions.ReturnStoredValue
import matlab.mock.actions.AssignOutputs
when(get(behavior.isOpen),ReturnStoredValue().then(AssignOutputs(true)))

% Use the mock.

isAccountOpen = mock.isOpen
isAccountOpen = mock.isOpen
isAccountOpen = mock.isOpen

% Copyright 2012 The MathWorks, Inc.