setupTestMethod

Class: matlab.unittest.plugins.TestRunnerPlugin
Package: matlab.unittest.plugins

Extend setting up test method

Description

example

setupTestMethod(plugin,pluginData) extends the setting up of a test method. This method defines how the TestRunner performs test method setup for the single test suite element. The testing framework evaluates this method within the scope of the runTest method of TestRunnerPlugin.

Input Arguments

plugin

Plugin object, specified as an instance of the matlab.unittest.plugins.TestRunnerPlugin class.

pluginData

Test method setup information, specified as an instance of the matlab.unittest.plugins.plugindata.ImplicitFixturePluginData class. The testing framework uses this information to describe the test content to the plugin.

Examples

expand all

classdef ExamplePlugin < matlab.unittest.plugins.TestRunnerPlugin
   
    methods (Access = protected)
        function setupTestMethod(plugin, pluginData)
            fprintf('### Setting up: %s\n', pluginData.Name)
            setupTestMethod@matlab.unittest.plugins.TestRunnerPlugin...
                (plugin, pluginData);
        end
    end
end

Introduced in R2014a