Question: 1 . Select the setUp and tearDown method. 2 . Select all of the methods of Gradebook, except for the constructor to create tests for.
Select the setUp and tearDown method.
Select all of the methods of Gradebook, except for the constructor to create tests for.
In the setUp method of GradebookTester, create at least two objects of Gradebook of size Call the addScore method for each of the Gradebook classes at least twice but no more than times
In the teardown method of GradebookTester, set the two objects of Gradebook to null;
Create test for the methods of Gradebook:
a addScore
i Use the toString method to compare the contents of what is in the scores array vs what is expected to be in the scores array
assertTrue
ii Compare the scoreSize to the expected number of scores entered.
assertEquals
b sum
i Compare what is returned by sum to the expected sum of the scores entered.
c minimum
i Compare what is returned by minimum to the expected minimum of the scores entered.
d finalScore
i Compare what is returned by finalScore to the expected finalscore of the scores entered.
The finalScore is the sum of the scores, with the lowest score dropped if there are at least two scores, or if there are no scores.
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
