Skip to content
Snippets Groups Projects
Verified Commit b27959ab authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

test(extendpolar): add option tests

parent 6db656c4
No related branches found
No related tags found
No related merge requests found
......@@ -126,6 +126,46 @@ verifyError(testCase, @() af_tools.extendpolar(DummyCd), 'MATLAB:nonExistentFiel
end
function test_invalidOptions(testCase)
% Error if invalid option name or missing parameter value
Dummy = dummysinglepolar();
wrongName = 'wrongoption';
verifyError(testCase, @() af_tools.extendpolar(Dummy, wrongName), 'MATLAB:InputParser:ParamMissingValue')
verifyError(testCase, @() af_tools.extendpolar(Dummy, wrongName, true), 'MATLAB:InputParser:UnmatchedParameter')
verifyError(testCase, @() af_tools.extendpolar(Dummy, 'method', 'Viterna', wrongName), 'MATLAB:InputParser:ParamMissingValue')
verifyError(testCase, @() af_tools.extendpolar(Dummy, 'method', 'Viterna', wrongName, true), 'MATLAB:InputParser:UnmatchedParameter')
end
function test_invalidOptionsVal(testCase)
% Error if valid option name but invalid value
Dummy = dummysinglepolar();
empty = [];
scal = 0;
char = 'test';
Struct = struct;
vect = 1:10;
verifyError(testCase, @() af_tools.extendpolar(Dummy, 'method', empty), 'MATLAB:extendpolar:unrecognizedStringChoice')
verifyError(testCase, @() af_tools.extendpolar(Dummy, 'method', scal), 'MATLAB:extendpolar:unrecognizedStringChoice')
verifyError(testCase, @() af_tools.extendpolar(Dummy, 'method', char), 'MATLAB:extendpolar:unrecognizedStringChoice')
verifyError(testCase, @() af_tools.extendpolar(Dummy, 'method', Struct), 'MATLAB:extendpolar:unrecognizedStringChoice')
verifyError(testCase, @() af_tools.extendpolar(Dummy, 'method', vect), 'MATLAB:extendpolar:unrecognizedStringChoice')
verifyError(testCase, @() af_tools.extendpolar(Dummy, 'limit', empty), 'MATLAB:extendpolar:unrecognizedStringChoice')
verifyError(testCase, @() af_tools.extendpolar(Dummy, 'limit', scal), 'MATLAB:extendpolar:unrecognizedStringChoice')
verifyError(testCase, @() af_tools.extendpolar(Dummy, 'limit', char), 'MATLAB:extendpolar:unrecognizedStringChoice')
verifyError(testCase, @() af_tools.extendpolar(Dummy, 'limit', Struct), 'MATLAB:extendpolar:unrecognizedStringChoice')
verifyError(testCase, @() af_tools.extendpolar(Dummy, 'limit', vect), 'MATLAB:extendpolar:unrecognizedStringChoice')
end
% ------------------------------------------------------------------------------
function test_noStall(testCase)
% Error if impossible to find the stall
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment