Main Content

matlab.mock.TestCase.forInteractiveUse

Class: matlab.mock.TestCase
Namespace: matlab.mock

Create test case for interactive use of mock objects

Syntax

testCase = matlab.mock.TestCase.forInteractiveUse

Description

testCase = matlab.mock.TestCase.forInteractiveUse creates a test case configured for interactive testing. The returned TestCase instance is suited for experimentation at the command prompt. It reacts to qualifications by printing messages to the screen for both passing and failing events.

Examples

expand all

Create a test case 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))

Version History

Introduced in R2017a