Main Content

setupTestMethod

Class: matlab.unittest.plugins.TestRunnerPlugin
Namespace: 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 test runner performs Test method setup for the single test suite element. The testing framework evaluates this method within the scope of the runTest method.

Input Arguments

expand all

Plugin, specified as a matlab.unittest.plugins.TestRunnerPlugin object.

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

Attributes

Accessprotected

To learn about attributes of methods, see Method Attributes.

Examples

expand all

Create a plugin and override the setupTestMethod method to display the Test method name at setup time.

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

Version History

Introduced in R2014a