teardownTestClass

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

Extend tearing down of test class

Syntax

teardownTestClass(plugin,pluginData)

Description

example

teardownTestClass(plugin,pluginData) extends the tearing down of a test class. This method defines how the TestRunner performs test class teardown. The test framework evaluates this method within the scope of the runTestClass method of the TestRunnerPlugin. If the test class contains properties with the ClassSetupParameter attribute, the test framework evaluates the teardownTestClass method as many times as the class setup parameterization dictates.

Input Arguments

plugin

Instance of matlab.unittest.plugins.TestRunnerPlugin.

pluginData

Test class teardown information, specified as an instance of matlab.unittest.plugins.plugindata.ImplicitFixturePluginData. The test framework uses this information to introspect into the test content.

Examples

expand all

Display the test class name at teardown time.

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

Introduced in R2014a

Was this topic helpful?