File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
src/test/java/com/fishercoder Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .fishercoder ;
2+
3+ import com .fishercoder .solutions ._4 ;
4+ import org .junit .BeforeClass ;
5+ import org .junit .Test ;
6+
7+ import static org .junit .Assert .assertEquals ;
8+
9+ public class _4Test {
10+ private static _4 .Solution1 solution1 ;
11+ private static _4 .Solution2 solution2 ;
12+ private static int [] A ;
13+ private static int [] B ;
14+
15+ @ BeforeClass
16+ public static void setup () {
17+ solution1 = new _4 .Solution1 ();
18+ solution2 = new _4 .Solution2 ();
19+ }
20+
21+ @ Test
22+ public void test1 () {
23+ A = new int []{1 , 3 };
24+ B = new int []{2 };
25+ assertEquals (2.0 , solution1 .findMedianSortedArrays (A , B ), 0.0 );
26+ assertEquals (2.0 , solution2 .findMedianSortedArrays (A , B ), 0.0 );
27+ }
28+
29+ @ Test
30+ public void test2 () {
31+ A = new int []{1 , 2 };
32+ B = new int []{3 , 4 };
33+ assertEquals (2.5 , solution1 .findMedianSortedArrays (A , B ), 0.0 );
34+ assertEquals (2.5 , solution2 .findMedianSortedArrays (A , B ), 0.0 );
35+ }
36+
37+ }
You can’t perform that action at this time.
0 commit comments