Files
Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestNullMatrixException.java
2026-01-26 16:21:57 -05:00

41 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 TestNullMatrixException{
private static final String MESSAGE = "message";
private static final Throwable CAUSE = new Exception();
@Test
public void testConstructor_default(){
NullMatrixException exception = new NullMatrixException();
assertNull(exception.getMessage());
assertNull(exception.getCause());
}
@Test
public void testConstructor_message(){
NullMatrixException exception = new NullMatrixException(MESSAGE);
assertEquals(MESSAGE, exception.getMessage());
assertNull(exception.getCause());
}
@Test
public void testConstructor_cause(){
NullMatrixException exception = new NullMatrixException(CAUSE);
assertEquals(CAUSE.toString(), exception.getMessage());
assertEquals(CAUSE, exception.getCause());
}
@Test
public void testConstructor_messageCause(){
NullMatrixException exception = new NullMatrixException(MESSAGE, CAUSE);
assertEquals(MESSAGE, exception.getMessage());
assertEquals(CAUSE, exception.getCause());
}
}