Question: Question 1 ) Details You are given Arthmatic.java which can be found on Canvas under the Lab directory. You must write JUnit tests for all
Question Details
You are given Arthmatic.java which can be found on Canvas under the Lab directory. You must write JUnit tests for all of the methods in the class. At least different tests for each method. Once you write one of the tests for a specific method, the other can be easily produced by copyingpasting the first one and adjusting the inputoutput parameters. it is important to test boundary inputs as most of the bugs are usually
found in those edge cases. If your tests cases are failing, because there is a bug in the given code, then it is okay. You are not required to fix the code; you just need to write the test cases for this assignment.
public class Arthmatic
public int multiplyint operand int operand
return operand operand;
public int subtractint operand int operand
return operand operand;
public int addint operand int operand
return operand operand;
public int divideint operand int operand
ifdivideByZerooperand
return a integer flag
return Integer.MAXVALUE;
else
return operandoperand;
public boolean divideByZeroint operand
ifoperand
return true;
else
return false;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
