Files
Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestInvalidGeometryException.java
Mattrixwv 2162130cd3 Bugfixes
Update tests
Add javadoc comments
2024-08-11 18:46:38 -04:00

46 lines
1.3 KiB
Java

//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestInvalidGeometryException.java
//Mattrixwv
// Created: 04-13-23
//Modified: 08-11-24
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());
}
}