File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
src/test/java/com/hackerrank/algorithms/arraysandsorting Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .hackerrank .algorithms .arraysandsorting ;
2+
3+ import static org .junit .Assert .assertArrayEquals ;
4+
5+ import org .junit .Test ;
6+ import org .junit .runner .RunWith ;
7+ import org .junit .runners .JUnit4 ;
8+
9+
10+ @ RunWith (JUnit4 .class )
11+ public class SampleTest {
12+ InsertionSort1 insertionSort1 = new InsertionSort1 ();
13+ @ Test
14+ public void tesInsertIntoSorted () {
15+ int [] inputArr = new int [] {1 ,2 ,4 };
16+ int [] inputResult = new int [] {1 ,2 ,4 };
17+ insertionSort1 .insertIntoSorted (inputArr );
18+ assertArrayEquals (inputResult , inputArr );
19+ }
20+
21+ @ Test
22+ public void tesInsertIntoSorted2 () {
23+ int [] inputArr = new int [] {1 ,6 ,4 };
24+ int [] inputResult = new int [] {1 , 4 , 6 };
25+ insertionSort1 .insertIntoSorted (inputArr );
26+ assertArrayEquals (inputResult , inputArr );
27+ }
28+
29+ }
You can’t perform that action at this time.
0 commit comments