Skip to content

Commit

Permalink
Create SolverTest.m
Browse files Browse the repository at this point in the history
  • Loading branch information
mcafaro authored Feb 5, 2024
1 parent 5a9baab commit a779c01
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions subfolder/SolverTest.m
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a779c01

Please sign in to comment.