Fix AbsoluteMin bug for equal absolute values (#6145)

* fix-absolute-max-bug

* clang-format for added junit

* fix-absolute-min-bug
This commit is contained in:
Muhammad Rizwan
2025-01-19 21:50:43 +05:00
committed by GitHub
parent 30d0c064a7
commit 0e0539ea6c
2 changed files with 8 additions and 2 deletions

View File

@@ -15,7 +15,13 @@ public class AbsoluteMinTest {
@Test
void testGetMinValueWithNoArguments() {
Exception exception = assertThrows(IllegalArgumentException.class, () -> AbsoluteMin.getMinValue());
Exception exception = assertThrows(IllegalArgumentException.class, AbsoluteMin::getMinValue);
assertEquals("Numbers array cannot be empty", exception.getMessage());
}
@Test
void testGetMinValueWithSameAbsoluteValues() {
assertEquals(-5, AbsoluteMin.getMinValue(-5, 5));
assertEquals(-5, AbsoluteMin.getMinValue(5, -5));
}
}