% Test Class Definition References: https://www.mathworks.com/help/matlab/matlab_prog/author-class-based-unit-tests-in-matlab.html https://www.mathworks.com/help/matlab/matlab_prog/write-setup-and-teardown-code-using-classes.html https://www.mathworks.com/help/matlab/matlab_prog/write-test-using-shared-fixtures.html https://www.mathworks.com/help/matlab/matlab_prog/create-basic-parameterized-test.html
0001 %% Test Class Definition 0002 % References: 0003 % https://www.mathworks.com/help/matlab/matlab_prog/author-class-based-unit-tests-in-matlab.html 0004 % https://www.mathworks.com/help/matlab/matlab_prog/write-setup-and-teardown-code-using-classes.html 0005 % https://www.mathworks.com/help/matlab/matlab_prog/write-test-using-shared-fixtures.html 0006 % https://www.mathworks.com/help/matlab/matlab_prog/create-basic-parameterized-test.html 0007 0008 classdef template < matlab.unittest.TestCase 0009 0010 % properties % shared properties 0011 % variable 0012 % end 0013 % 0014 % properties (TestParameter) % parametric cases 0015 % type = {'single','double','uint16'}; 0016 % level = struct('small', 2,'medium', 4, 'large', 6); 0017 % side = struct('small', 9, 'medium', 81,'large', 729); 0018 % end 0019 % 0020 % methods (TestMethodSetup) 0021 % function createFixture(testCase) 0022 % testCase.variable = figure; 0023 % testCase.addTeardown(@close, testCase.variable) 0024 % end 0025 % end 0026 0027 %% Test Method Block 0028 % methods (Test, TestTags = {'Tag'}) 0029 % function test1(testCase) 0030 % testCase.verifyEqual(testOut, expectedOut); 0031 % end 0032 0033 % function parametricTest1(testCase, type, level) 0034 % end 0035 % end 0036 end