MATLAB: Matlab.unittest.testCase to prove that no toolboxes are used for specific functions

MATLABooptestcaseunit test

Hey all,
I have an assignment to use the matlab.unittest.testcase, as stated in the title, to prove that no toolboxes are used for three specific functions. In addition I have to check if all required variables are set after executing a specific function. I've done some research, but I am still not sure how to solve this issue. Beneath this is the given code for this assignment. Can anyone help me getting started?
%%
classdef test < matlab.unittest.TestCase
%Test your challenge solution here using matlab unit tests
%

% Check if your main file '*****.m', '********.m' and
% '****'.m do not use any toolboxes.
%
% Check if all your required variables are set after executing
% the file '******.m'
properties
end
methods
end
end
*edit: removed file name and added the given code as code
Best regards,
Øivind Bakke

Best Answer

For those interested, here is how I solved it, but it's only a part of a bigger solution and is subject to change:
classdef test < matlab.unittest.TestCase
properties
end
methods (Test)
function test_toolboxes(testCase)
testCase.verifyFalse(check_toolboxes('*****.m'));
testCase.verifyFalse(check_toolboxes('****.m'));
testCase.verifyFalse(check_toolboxes('***.m'));
end
function test_variables(testCase)
Function; %Call the function containing the variables to be tested
testCase.verifyNotEmpty(members);
testCase.verifyNotEmpty(mail);
testCase.verifyEqual(group_number,59);
testCase.verifyGreaterThan(elapsed_time,0);
testCase.verifyGreaterThan(D,0);
testCase.verifyGreaterThan(R,0);
testCase.verifyGreaterThan(T,0);
testCase.verifyGreaterThan(p,0);
end
end
end
function toolboxes_in_use = check_toolboxes(fctname)
[fList,pList]=matlab.codetools.requiredFilesAndProducts(fctname);
if (size({pList.Name}',1)>1) %True if a toolbox is used. (MATLAB will be listed as default)
toolboxes_in_use=true;
else
toolboxes_in_use=false;
end
end