Updated libraries and increased test coverage

This commit is contained in:
2023-04-13 19:08:46 -04:00
parent d1b083f4de
commit f746f93427
11 changed files with 397 additions and 34 deletions

View File

@@ -0,0 +1,37 @@
//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestInvalidCoordinatesException.java
//Mattrixwv
// Created: 04-13-23
//Modified: 04-13-23
package com.mattrixwv.matrix.exceptions;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import org.junit.jupiter.api.Test;
public class TestInvalidCoordinatesException{
private String message = "message";
private Throwable cause = new Exception();
@Test
public void testConstructor(){
InvalidCoordinatesException exception = new InvalidCoordinatesException();
assertNull(exception.getMessage());
assertNull(exception.getCause());
exception = new InvalidCoordinatesException(message);
assertEquals(message, exception.getMessage());
assertNull(exception.getCause());
exception = new InvalidCoordinatesException(cause);
assertEquals(cause.toString(), exception.getMessage());
assertEquals(cause, exception.getCause());
exception = new InvalidCoordinatesException(message, cause);
assertEquals(message, exception.getMessage());
assertEquals(cause, exception.getCause());
}
}

View File

@@ -0,0 +1,37 @@
//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestInvalidGeometryException.java
//Mattrixwv
// Created: 04-13-23
//Modified: 04-13-23
package com.mattrixwv.matrix.exceptions;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import org.junit.jupiter.api.Test;
public class TestInvalidGeometryException{
private String message = "message";
private Throwable cause = new Exception();
@Test
public void testConstructor(){
InvalidGeometryException exception = new InvalidGeometryException();
assertNull(exception.getMessage());
assertNull(exception.getCause());
exception = new InvalidGeometryException(message);
assertEquals(message, exception.getMessage());
assertNull(exception.getCause());
exception = new InvalidGeometryException(cause);
assertEquals(cause.toString(), exception.getMessage());
assertEquals(cause, exception.getCause());
exception = new InvalidGeometryException(message, cause);
assertEquals(message, exception.getMessage());
assertEquals(cause, exception.getCause());
}
}

View File

@@ -0,0 +1,37 @@
//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestInvalidRowSizeException.java
//Mattrixwv
// Created: 04-13-23
//Modified: 04-13-23
package com.mattrixwv.matrix.exceptions;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import org.junit.jupiter.api.Test;
public class TestInvalidRowSizeException{
private String message = "message";
private Throwable cause = new Exception();
@Test
public void testConstructor(){
InvalidRowSizeException exception = new InvalidRowSizeException();
assertNull(exception.getMessage());
assertNull(exception.getCause());
exception = new InvalidRowSizeException(message);
assertEquals(message, exception.getMessage());
assertNull(exception.getCause());
exception = new InvalidRowSizeException(cause);
assertEquals(cause.toString(), exception.getMessage());
assertEquals(cause, exception.getCause());
exception = new InvalidRowSizeException(message, cause);
assertEquals(message, exception.getMessage());
assertEquals(cause, exception.getCause());
}
}

View File

@@ -0,0 +1,37 @@
//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestInvalidScalarException.java
//Mattrixwv
// Created: 04-13-23
//Modified: 04-13-23
package com.mattrixwv.matrix.exceptions;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import org.junit.jupiter.api.Test;
public class TestInvalidScalarException{
private String message = "message";
private Throwable cause = new Exception();
@Test
public void testConstructor(){
InvalidScalarException exception = new InvalidScalarException();
assertNull(exception.getMessage());
assertNull(exception.getCause());
exception = new InvalidScalarException(message);
assertEquals(message, exception.getMessage());
assertNull(exception.getCause());
exception = new InvalidScalarException(cause);
assertEquals(cause.toString(), exception.getMessage());
assertEquals(cause, exception.getCause());
exception = new InvalidScalarException(message, cause);
assertEquals(message, exception.getMessage());
assertEquals(cause, exception.getCause());
}
}

View File

@@ -0,0 +1,37 @@
//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestNullMatrixException.java
//Mattrixwv
// Created: 04-13-23
//Modified: 04-13-23
package com.mattrixwv.matrix.exceptions;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import org.junit.jupiter.api.Test;
public class TestNullMatrixException{
private String message = "message";
private Throwable cause = new Exception();
@Test
public void testConstructor(){
NullMatrixException exception = new NullMatrixException();
assertNull(exception.getMessage());
assertNull(exception.getCause());
exception = new NullMatrixException(message);
assertEquals(message, exception.getMessage());
assertNull(exception.getCause());
exception = new NullMatrixException(cause);
assertEquals(cause.toString(), exception.getMessage());
assertEquals(cause, exception.getCause());
exception = new NullMatrixException(message, cause);
assertEquals(message, exception.getMessage());
assertEquals(cause, exception.getCause());
}
}