mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-08-01 18:49:39 +08:00
22 lines
644 B
Java
22 lines
644 B
Java
package com.thealgorithms.maths;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
public class AbsoluteMinTest {
|
|
|
|
@Test
|
|
void testGetMinValue() {
|
|
assertEquals(0, AbsoluteMin.getMinValue(4, 0, 16));
|
|
assertEquals(-2, AbsoluteMin.getMinValue(3, -10, -2));
|
|
}
|
|
|
|
@Test
|
|
void testGetMinValueWithNoArguments() {
|
|
Exception exception = assertThrows(IllegalArgumentException.class, () -> AbsoluteMin.getMinValue());
|
|
assertEquals("Numbers array cannot be empty", exception.getMessage());
|
|
}
|
|
}
|