Bugfixes
Update tests Add javadoc comments
This commit is contained in:
@@ -1,36 +1,44 @@
|
||||
//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestInvalidScalarException.java
|
||||
//Mattrixwv
|
||||
// Created: 04-13-23
|
||||
//Modified: 04-13-23
|
||||
//Modified: 08-11-24
|
||||
package com.mattrixwv.matrix.exceptions;
|
||||
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
public class TestInvalidScalarException{
|
||||
private String message = "message";
|
||||
private Throwable cause = new Exception();
|
||||
private static final String message = "message";
|
||||
private static final Throwable cause = new Exception();
|
||||
|
||||
|
||||
@Test
|
||||
public void testConstructor(){
|
||||
public void testConstructor_default(){
|
||||
InvalidScalarException exception = new InvalidScalarException();
|
||||
assertNull(exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
|
||||
exception = new InvalidScalarException(message);
|
||||
@Test
|
||||
public void testConstructor_message(){
|
||||
InvalidScalarException exception = new InvalidScalarException(message);
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
|
||||
exception = new InvalidScalarException(cause);
|
||||
@Test
|
||||
public void testConstructor_cause(){
|
||||
InvalidScalarException exception = new InvalidScalarException(cause);
|
||||
assertEquals(cause.toString(), exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
}
|
||||
|
||||
exception = new InvalidScalarException(message, cause);
|
||||
@Test
|
||||
public void testConstructor_messageCause(){
|
||||
InvalidScalarException exception = new InvalidScalarException(message, cause);
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user