Question: X 1 2 8 4 : Write JUnit Test for LinearSearch You have to write a test case with three assertions to test a linear
X: Write JUnit Test for LinearSearch
You have to write a test case with three assertions to test a linear search routine. You should test three cases. One test with a va not there. Another one with a value in the first position of the array, and one last one checking the last position of the array. Ass linearSearch looks as shown below.
int linearSearchint int t
II if is not found, it returns If found,
it returns the index.
Complete the testLinearSearch method a JUnit method below.
public void testone
p
int nums ;
II Write three assertEquals below as described above.
Remember that the assertEquals definition
isas follows:
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
