returnStoredValueWhen
클래스: matlab.mock.TestCase
네임스페이스: matlab.mock
속성이 액세스되면 저장된 값 반환
구문
returnStoredValueWhen(testcase,behavior)
설명
입력 인수
예제
대안
returnStoredValueWhen 메서드를 사용하는 것은 PropertyGetBehavior 클래스의 when 메서드와 함께 matlab.mock.actions.ReturnStoredValue 동작을 사용하는 것과 기능적으로 동일합니다. 예를 들어, 다음 코드 블록들은 기능적으로 동일합니다.
% Using the returnStoredValueWhen method testCase.returnStoredValueWhen(get(behavior.PropertyFoo)); % Using the ReturnStoredValue action with the when function import matlab.mock.actions.ReturnStoredValue; when(get(behavior.PropertyFoo),ReturnStoredValue);
ReturnStoredValue 동작을 사용하면 추가적인 기능을 사용할 수 있습니다. 예를 들어, 동일한 모의 객체 상호 작용에 대해 다른 후속 동작을 지정할 수 있습니다.버전 내역
R2017a에 개발됨