Main Content

setupTestClass

Class: matlab.unittest.plugins.TestRunnerPlugin
Namespace: matlab.unittest.plugins

Extend setting up test class

Description

example

setupTestClass(plugin,pluginData) extends the setting up of a test class. This method defines how the test runner performs test class setup. The testing framework evaluates this method within the scope of the runTestClass method. If the test class contains properties with the ClassSetupParameter attribute, the testing framework evaluates the setupTestClass method as many times as the class setup parameterization dictates.

Input Arguments

expand all

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

Test class 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 setupTestClass method to display the test class name at setup time.

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

Version History

Introduced in R2014a