51 lines
1.4 KiB
Matlab
51 lines
1.4 KiB
Matlab
classdef Testclass_template < matlab.unittest.TestCase
|
|
|
|
properties
|
|
%genereal properties of the test
|
|
end
|
|
|
|
properties (MethodSetupParameter)
|
|
% Define method-level parameters for PRBS and bit pattern
|
|
% i.e.: useprbs = {0,1};
|
|
useprbs = {0,1};
|
|
M = {2,4,6};
|
|
end
|
|
|
|
properties (TestParameter)
|
|
% Define test-level parameters for M and O
|
|
|
|
end
|
|
|
|
methods (TestMethodSetup)
|
|
|
|
function setupTest(testCase, useprbs, M)
|
|
% Setup everything that is somehow reguired for the test,
|
|
% include the MethodSetupParameters here as arguments
|
|
end
|
|
|
|
end
|
|
|
|
methods (Test)
|
|
% Test with sequential combination of parameters
|
|
function myTest(testCase, M, useprbs)
|
|
% Write the actual test,
|
|
% include the MethodSetupParameters here as arguments
|
|
|
|
% Assert that BER is zero
|
|
testCase.verifyEqual(M, M, 'error message');
|
|
testCase.verifyEqual(useprbs, useprbs, 'error message');
|
|
end
|
|
|
|
% Test with sequential combination of parameters
|
|
function anotherTest(testCase, M)
|
|
% Write the actual test,
|
|
% include the MethodSetupParameters here as arguments
|
|
|
|
% Assert that BER is zero
|
|
testCase.verifyEqual(M, M, 'error message');
|
|
testCase.verifyClass(M,'double');
|
|
end
|
|
end
|
|
|
|
end
|