Hi aoisdjas alsjdlsajd,
I understand that you are trying to mock a set method for a property in MATLAB. MATLAB does not support mocking property set methods directly using “matlab.mock.TestCase.assignOutputsWhen”. In MATLAB, property accessors like get and set are not methods in the same way regular class methods are. The error is expected because “set.blablabla” is not a callable method you can reference like “obj.someMethod”.
I would instead suggest you to wrap the setter logic in a regular method. Define a regular method like “setBlablabla()”:
methods
function setBlablabla(obj, value)
obj.blablabla = value; % raw property set
% Do more stuff here
end
end
Then you can mock that method easily as follows:
testCase.assignOutputsWhen(...
withAnyInputs(behaviorObj.setBlablabla), DoNothing);
Hope this is helpful!