Files
Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestInvalidGeometryException.java

42 lines
1.1 KiB
Java

package com.mattrixwv.matrix.exceptions;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
public class TestInvalidGeometryException{
private static final String MESSAGE = "message";
private static final Throwable CAUSE = new Exception();
@Test
public void testConstructor_default(){
InvalidGeometryException exception = new InvalidGeometryException();
assertNull(exception.getMessage());
assertNull(exception.getCause());
}
@Test
public void testConstructor_message(){
InvalidGeometryException exception = new InvalidGeometryException(MESSAGE);
assertEquals(MESSAGE, exception.getMessage());
assertNull(exception.getCause());
}
@Test
public void testConstructor_cause(){
InvalidGeometryException exception = new InvalidGeometryException(CAUSE);
assertEquals(CAUSE.toString(), exception.getMessage());
assertEquals(CAUSE, exception.getCause());
}
@Test
public void testConstructor_messageCause(){
InvalidGeometryException exception = new InvalidGeometryException(MESSAGE, CAUSE);
assertEquals(MESSAGE, exception.getMessage());
assertEquals(CAUSE, exception.getCause());
}
}