matlab.mock.TestCase.forInteractiveUse

Class: matlab.mock.TestCase
Package: matlab.mock

Create TestCase for interactive use of mock objects

Syntax

tc = matlab.mock.TestCase.forInteractiveUse

Description

tc = matlab.mock.TestCase.forInteractiveUse creates a matlab.mock.TestCase instance for interactive use. The TestCase is configured so you can experiment with it at the MATLAB® command prompt. The TestCase reacts to qualification failures and successes by displaying messages to the screen for both passing and failing conditions.

Examples

expand all

Create a TestCase configured for interactive use at the MATLAB command prompt.

import matlab.mock.TestCase;
testCase = TestCase.forInteractiveUse;

Create a mock.

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

Produce a failing verification.

testCase.verifyCalled(behavior.myMethod(123));

Introduced in R2017a