I'm trying to use the mocking framework for unit tests
I'm trying to make the property of a mock object return another mock object, but the behavior object doesn't have the property
properties (GetAccess=public, SetAccess=protected)
function this = answer()
this is the mock decleration:
testCase = matlab.mock.TestCase.forInteractiveUse;
[mock,behav] = testCase.createMock(?MyClass);
mock.prop1 = "";
You cannot set the read-only property 'prop1' of MyClassMock.
p = behav.prop1;
No appropriate method, property, or field 'prop1' for class 'matlab.mock.classes.MyClassBehavior'.
now i can't set the value of the mock object because the set access is protected
and i can't use the behavior object to change the property behavior because I can't find the propertyBehavior thing anywhere
I'm obviously missing something, but all the examples I've seen in the documentation show how to use a custom mock object with "AddedProperties"
and I could be tackling this the wrong way, but I prefer to create the mock object using the meta class