package org.hfeng.leet.mediantwosortedarrays;

import org.junit.Test;
import org.junit.Before;
import org.junit.After;

import static org.junit.Assert.assertEquals;

public class SolutionTest {

    Solution solution;

    @Before
    public void before() throws Exception {
        solution = new Solution();
    }

    @After
    public void after() throws Exception {
    }

    /**
     * Method: findMedianSortedArrays(int A[], int B[])
     */
    @Test
    public void testFindMedianSortedArrays() throws Exception {
        Solution solution = new Solution();
        int[] a = {1, 2};
        int[] b = {1, 1};
        final float delta = 0.0001F;
        assertEquals(1.0, solution.findMedianSortedArrays(a, b), delta);

        int[] a = {1, 2};
        int[] b = {1, 2};
        final float delta = 0.0001F;
        assertEquals(1.5, solution.findMedianSortedArrays(a, b), delta);

    }

}

@@ -731,32 +731,33 @@
 %0A        int%5B%5D a
+2
  = %7B1, 2%7D;%0A     
@@ -762,24 +762,25 @@
      int%5B%5D b
+2
  = %7B1, 2%7D;%0A 
@@ -782,45 +782,8 @@
 2%7D;%0A
-        final float delta = 0.0001F;%0A
     
@@ -829,35 +829,37 @@
 anSortedArrays(a
+2
 , b
+2
 ), delta);%0A%0A    

make the test pass