Mock Dependencies in Tests - MATLAB & Simulink (original) (raw)

Main Content

Use the mocking framework to isolate a portion of a system to test by imitating the behavior of dependencies

When unit testing, you are often interested in testing a portion of a complete system isolated from dependencies. To test a portion of the system, we can use_mock objects_ to replace the dependencies. A mock object implements at least part of the same interface as the production object, but often in a simpler, faster, more predictable, or more controllable way.

To get started, see Create Mock Object.

Test a component using mocked-up dependencies.

Classes

Topics