package com.matao;

/**
 * Created by matao on 2019-01-06.
 */
public class Q40_KLeastNumbersTest {
}

@@ -17,86 +17,944 @@
 o;%0A%0A
-/**%0A * Created by matao on 2019-01-06.%0A */%0Apublic class Q40_KLeastNumbersTest %7B
+import org.junit.jupiter.api.Assertions;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Test;%0A%0A/**%0A * Created by matao on 2019-01-06.%0A */%0Apublic class Q40_KLeastNumbersTest %7B%0A%0A    private Q40_KLeastNumbers kLeastNumbers;%0A%0A    @BeforeEach%0A    void setUp() %7B%0A        kLeastNumbers = new Q40_KLeastNumbers();%0A    %7D%0A%0A    @Test%0A    void testNull() %7B%0A        Assertions.assertEquals(Integer.MIN_VALUE, kLeastNumbers.getLeastNumbers(null, 1));%0A    %7D%0A%0A    @Test%0A    void testEmptyArray() %7B%0A        int%5B%5D a = %7B%7D;%0A        Assertions.assertEquals(Integer.MIN_VALUE, kLeastNumbers.getLeastNumbers(a, 1));%0A    %7D%0A%0A    @Test%0A    void test1() %7B%0A        int%5B%5D array = %7B4, 5, 1, 6, 2, 7, 3, 8%7D;%0A        Assertions.assertEquals(4, kLeastNumbers.getLeastNumbers(array, 4));%0A    %7D%0A%0A    @Test%0A    void test2() %7B%0A        int%5B%5D array = %7B6, 1, 3, 5, 4, 2%7D;%0A        Assertions.assertEquals(5, kLeastNumbers.getLeastNumbers(array, 5));%0A    %7D
 %0A%7D%0A

add test cases for KLeastNumbers