%% Get Test Inputs
% This example shows how to get the test inputs to a test case.

% Copyright 2020 The MathWorks, Inc.

%% Load the Example Model and Create a New Test File
open_system('sltestExcelExample');
tf = sltest.testmanager.TestFile('input_test_file.mldatx');
%% Get the Test Suite and Test Case Objects
ts = getTestSuites(tf);
tc = getTestCases(ts);

%% Add the Model as the System Under Test
setProperty(tc,'Model','sltestExcelExample');

%% Add Excel Data to Inputs Section and Specify Sheets to Add
excelfile = 'sltestExampleInputs.xlsx';
input = addInput(tc,excelfile,'Sheets',["Acceleration","Braking"]);

%% Map the Input Signal for the Sheets by Block Name
map(input(1),0);
map(input(2),0);

%% Get and Check the Test Inputs
inputsOut = getInputs(tc);
inputsOut.ExcelSpecifications