Main Content

teardownTestMethod

类: matlab.unittest.plugins.TestRunnerPlugin
命名空间: matlab.unittest.plugins

扩展拆解 Test 方法

说明

示例

teardownTestMethod(plugin,pluginData) 扩展 Test 方法的拆解。此方法定义测试运行器如何为单个测试套件元素执行 Test 方法拆解。测试框架在 runTest 方法的作用域内计算此方法。

输入参数

全部展开

插件,指定为 matlab.unittest.plugins.TestRunnerPlugin 对象。

Test 方法拆解信息,指定为 matlab.unittest.plugins.plugindata.ImplicitFixturePluginData 对象。测试框架使用此信息来描述该插件的测试内容。

属性

Accessprotected

要了解方法的属性,请参阅方法属性

示例

全部展开

创建一个插件并覆盖 teardownTestMethod 方法以在拆解时显示 Test 方法名称。

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

版本历史记录

在 R2014a 中推出