setupTestClass

Class: matlab.unittest.plugins.TestRunnerPlugin
Package: 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 TestRunner performs test class setup. The testing framework evaluates this method within the scope of the runTestClass method of TestRunnerPlugin. 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

plugin

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

pluginData

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

Examples

expand all

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
Introduced in R2014a