From 02bac7e3d4f152a2369dca61cc1b2a1664bbcf24 Mon Sep 17 00:00:00 2001 From: Piotr Idzik <65706193+vil02@users.noreply.github.com> Date: Tue, 26 Sep 2023 07:41:27 +0200 Subject: [PATCH] Add test case with minimum not at index 0 (#4403) --- src/test/java/com/thealgorithms/maths/FindMinTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/thealgorithms/maths/FindMinTest.java b/src/test/java/com/thealgorithms/maths/FindMinTest.java index 7884b4b79..e713c0191 100644 --- a/src/test/java/com/thealgorithms/maths/FindMinTest.java +++ b/src/test/java/com/thealgorithms/maths/FindMinTest.java @@ -12,13 +12,14 @@ import org.junit.jupiter.params.provider.MethodSource; public class FindMinTest { @ParameterizedTest - @MethodSource("provideStringsForIsBlank") + @MethodSource("inputStream") void numberTests(int expected, int[] input) { Assertions.assertEquals(expected, FindMin.findMin(input)); } - private static Stream provideStringsForIsBlank() { - 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})); + private static Stream inputStream() { + 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}), + Arguments.of(-4, new int[] {4, -3, 8, 9, -4, -4, 10})); } @Test