diff --git a/subfolder/SolverTest.m b/subfolder/SolverTest.m new file mode 100644 index 0000000..c670e11 --- /dev/null +++ b/subfolder/SolverTest.m @@ -0,0 +1,18 @@ +classdef SolverTest < matlab.unittest.TestCase + methods(Test) + function realSolution(testCase) + actSolution = quadraticSolver(1,-3,2); + expSolution = [2 1]; + testCase.verifyEqual(actSolution,expSolution) + end + function imaginarySolution(testCase) + actSolution = quadraticSolver(1,2,10); + expSolution = [-1+3i -1-3i]; + testCase.verifyEqual(actSolution,expSolution) + end + function nonnumericInput(testCase) + testCase.verifyError(@()quadraticSolver(1,'-3',2), ... + 'quadraticSolver:InputMustBeNumeric') + end + end +end