Bugfixes
Update tests Add javadoc comments
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,37 +1,55 @@
|
||||
//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestInvalidCoordinatesException.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 TestInvalidCoordinatesException{
|
||||
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(){
|
||||
InvalidCoordinatesException exception = new InvalidCoordinatesException();
|
||||
assertNull(exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
|
||||
exception = new InvalidCoordinatesException(message);
|
||||
}
|
||||
@Test
|
||||
public void testConstructor_message(){
|
||||
InvalidCoordinatesException exception = new InvalidCoordinatesException(message);
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
|
||||
exception = new InvalidCoordinatesException(cause);
|
||||
@Test
|
||||
public void testConstructor_cause(){
|
||||
InvalidCoordinatesException exception = new InvalidCoordinatesException(cause);
|
||||
assertEquals(cause.toString(), exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
|
||||
exception = new InvalidCoordinatesException(message, cause);
|
||||
}
|
||||
@Test
|
||||
public void testConstructor_messageCause(){
|
||||
InvalidCoordinatesException exception = new InvalidCoordinatesException(message, cause);
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstructor_elements(){
|
||||
int givenElements = 3;
|
||||
int neededElements = 2;
|
||||
String elementsMessage = "Invalid number of elements " + givenElements + " must be at most " + neededElements;
|
||||
|
||||
InvalidCoordinatesException exception = new InvalidCoordinatesException(givenElements, neededElements);
|
||||
|
||||
assertEquals(elementsMessage, exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,44 @@
|
||||
//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestInvalidGeometryException.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 TestInvalidGeometryException{
|
||||
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(){
|
||||
InvalidGeometryException exception = new InvalidGeometryException();
|
||||
assertNull(exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
|
||||
exception = new InvalidGeometryException(message);
|
||||
@Test
|
||||
public void testConstructor_message(){
|
||||
InvalidGeometryException exception = new InvalidGeometryException(message);
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
|
||||
exception = new InvalidGeometryException(cause);
|
||||
@Test
|
||||
public void testConstructor_cause(){
|
||||
InvalidGeometryException exception = new InvalidGeometryException(cause);
|
||||
assertEquals(cause.toString(), exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
}
|
||||
|
||||
exception = new InvalidGeometryException(message, cause);
|
||||
@Test
|
||||
public void testConstructor_messageCause(){
|
||||
InvalidGeometryException exception = new InvalidGeometryException(message, cause);
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
}
|
||||
|
||||
@@ -1,36 +1,44 @@
|
||||
//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestInvalidRowSizeException.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 TestInvalidRowSizeException{
|
||||
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(){
|
||||
InvalidRowSizeException exception = new InvalidRowSizeException();
|
||||
assertNull(exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
|
||||
exception = new InvalidRowSizeException(message);
|
||||
@Test
|
||||
public void testConstructor_message(){
|
||||
InvalidRowSizeException exception = new InvalidRowSizeException(message);
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
|
||||
exception = new InvalidRowSizeException(cause);
|
||||
@Test
|
||||
public void testConstructor_cause(){
|
||||
InvalidRowSizeException exception = new InvalidRowSizeException(cause);
|
||||
assertEquals(cause.toString(), exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
}
|
||||
|
||||
exception = new InvalidRowSizeException(message, cause);
|
||||
@Test
|
||||
public void testConstructor_messageCause(){
|
||||
InvalidRowSizeException exception = new InvalidRowSizeException(message, cause);
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -1,36 +1,43 @@
|
||||
//Matrix/src/test/java/com/mattrixwv/matrix/exceptions/TestNullMatrixException.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 TestNullMatrixException{
|
||||
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(){
|
||||
NullMatrixException exception = new NullMatrixException();
|
||||
assertNull(exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
|
||||
exception = new NullMatrixException(message);
|
||||
@Test
|
||||
public void testConstructor_message(){
|
||||
NullMatrixException exception = new NullMatrixException(message);
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
|
||||
exception = new NullMatrixException(cause);
|
||||
@Test
|
||||
public void testConstructor_cause(){
|
||||
NullMatrixException exception = new NullMatrixException(cause);
|
||||
assertEquals(cause.toString(), exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
|
||||
exception = new NullMatrixException(message, cause);
|
||||
}
|
||||
@Test
|
||||
public void testConstructor_messageCause(){
|
||||
NullMatrixException exception = new NullMatrixException(message, cause);
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user