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

X1284: 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.
1 int linearSearch(int s, int nt t
2 II if s is not found, it returns -1. If found,
3 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
is.as follows:
 X1284: Write JUnit Test for LinearSearch You have to write a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!