I found at least one solution to it with using self defined constraint:
classdef IsAny < matlab.unittest.constraints.Constraint
methods
function is_satisfied = satisfiedBy(~, ~)
is_satisfied = true;
end
function diag = getDiagnosticFor(~, ~)
import matlab.unittest.diagnostics.StringDiagnostic;
diag = StringDiagnostic('IsAny passed.');
end
end
end
Using this, we can do things like
verifyThat(fooBar(IsAny(), Data, IsAny()), WasCalled)
to verify that fooBar has been called and second parameter equals Data, where the first and the last are ignored.
Is there a Matlab build-in solution to this?