function tests = solverTest
tests = functiontests(localfunctions);
endfunction testRealSolution(testCase)
actSolution = quadraticSolver(1,-3,2);
expSolution = [2 1];
verifyEqual(testCase,actSolution,expSolution)
endfunction testImaginarySolution(testCase)
actSolution = quadraticSolver(1,2,10);
expSolution = [-1+3i -1-3i];
verifyEqual(testCase,actSolution,expSolution)
endRun Tests in solverTest FunctionRun the tests.results = runtests('solverTest.m')Running solverTest
..
Done solverTest
__________results =1x2 TestResult array with properties:Name
Passed
Failed
Incomplete
DurationTotals:
2 Passed, 0 Failed, 0 Incomplete.
0.19172 seconds testing time.Both of the tests passed.33 Unit Testing