remove

Class: sltest.testmanager.TestInput
Package: sltest.testmanager

Remove test input

Syntax

remove

Description

remove removes the test input from a test case. The test input object is empty after a call to this function.

Input Arguments

expand all

The test input that you want to remove, specified as a sltest.testmanager.TestInput object.

Examples

expand all

% Load example model
open_system('sltestExcelExample');

% Create new test file
tf = sltest.testmanager.TestFile('C:\MATLAB\input_test_file.mldatx');
% Get test suite object
ts = getTestSuites(tf);
% Get test case object
tc = getTestCases(ts);

% Add the example model as the system under test
setProperty(tc,'Model','sltestExcelExample');

% Add Excel data to Inputs section
% Excel file has three sheets, creating three inputs
input_path = fullfile(matlabroot,'toolbox','simulinktest',...
             'simulinktestdemos','sltestExampleInputs.xlsx');
input = addInput(tc,input_path);

% Map the input signals by block name for the first two inputs
map(input(1),0);
map(input(2),0);

% Remove the third input, a blank sheet
remove(input(3));

Introduced in R2015b