Skip to content

Commit 02bac7e

Browse files
authored
Add test case with minimum not at index 0 (TheAlgorithms#4403)
1 parent cada67b commit 02bac7e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/test/java/com/thealgorithms/maths/FindMinTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
public class FindMinTest {
1313

1414
@ParameterizedTest
15-
@MethodSource("provideStringsForIsBlank")
15+
@MethodSource("inputStream")
1616
void numberTests(int expected, int[] input) {
1717
Assertions.assertEquals(expected, FindMin.findMin(input));
1818
}
1919

20-
private static Stream<Arguments> provideStringsForIsBlank() {
21-
return Stream.of(Arguments.of(1, new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}), Arguments.of(5, new int[] {5, 5, 5, 5, 5}), Arguments.of(0, new int[] {0, 192, 384, 576}), Arguments.of(-1, new int[] {-1, 2, 5, 10}), Arguments.of(-10, new int[] {-10, -9, -8, -7, -6, -5, -4, -3, -2, -1}));
20+
private static Stream<Arguments> inputStream() {
21+
return Stream.of(Arguments.of(1, new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}), Arguments.of(5, new int[] {5, 5, 5, 5, 5}), Arguments.of(0, new int[] {0, 192, 384, 576}), Arguments.of(-1, new int[] {-1, 2, 5, 10}), Arguments.of(-10, new int[] {-10, -9, -8, -7, -6, -5, -4, -3, -2, -1}),
22+
Arguments.of(-4, new int[] {4, -3, 8, 9, -4, -4, 10}));
2223
}
2324

2425
@Test

0 commit comments

Comments
 (0)