%% Specify Method Call with Any Inputs
% Create a mock with a myMethod method.

testCase = matlab.mock.TestCase.forInteractiveUse;
[mock,behavior] = testCase.createMock('AddedMethods',"myMethod");

% Set up the behavior. Regardless of the inputs to the method, it returns "hello".

testCase.assignOutputsWhen(withAnyInputs(behavior.myMethod),"hello")

% Call the method with various inputs.

output = mock.myMethod
output = mock.myMethod(123)
output = myMethod("abc",mock)

% Verify that the method was called at least once with some set of inputs.

testCase.verifyCalled(withAnyInputs(behavior.myMethod))

% Copyright 2012 The MathWorks, Inc.