mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-06 17:29:31 +08:00
@ -9,32 +9,26 @@ public class FindMinTest {
|
||||
|
||||
@Test
|
||||
public void testFindMinValue() {
|
||||
assertEquals(
|
||||
1,
|
||||
FindMin.findMin(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 })
|
||||
);
|
||||
assertEquals(1, FindMin.findMin(new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test1() {
|
||||
assertEquals(1, FindMin.findMin(new int[] { 1, 3, 5, 7, 9 }));
|
||||
assertEquals(1, FindMin.findMin(new int[] {1, 3, 5, 7, 9}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test2() {
|
||||
assertEquals(0, FindMin.findMin(new int[] { 0, 192, 384, 576 }));
|
||||
assertEquals(0, FindMin.findMin(new int[] {0, 192, 384, 576}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3() {
|
||||
assertEquals(0, FindMin.findMin(new int[] { 10, 10, 0, 10 }));
|
||||
assertEquals(0, FindMin.findMin(new int[] {10, 10, 0, 10}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindMinThrowsExceptionForEmptyInput() {
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> FindMin.findMin(new int[]{})
|
||||
);
|
||||
assertThrows(IllegalArgumentException.class, () -> FindMin.findMin(new int[] {}));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user