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

@@ -1,7 +1,7 @@
//Matrix/src/test/java/com/mattrixwv/matrix/TestIntegerMatrix.java
//Mattrixwv
// Created: 02-01-22
//Modified: 07-09-22
//Modified: 04-13-23
package com.mattrixwv.matrix;
@@ -199,8 +199,8 @@ public class TestIntegerMatrix{
public void testEquals(){
//Invalid equals
IntegerMatrix matrix = new IntegerMatrix(grid1);
assertNotEquals(null, matrix);
assertNotEquals(new double[0], matrix);
assertNotEquals(matrix, null);
assertNotEquals(matrix, new double[0]);
//1x1
matrix = new IntegerMatrix(grid1);
@@ -1849,4 +1849,38 @@ public class TestIntegerMatrix{
String matrixString = "[1,2,3]\n[1,2,3]\n[1,2,3]";
assertEquals(matrixString, matrix.toString());
}
@Test
public void testLaplaceExpansionHelper(){
IntegerMatrixPublic matrix = new IntegerMatrixPublic();
matrix.addRow(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix.laplaceExpansionHelper(0, 0);
});
IntegerMatrixPublic matrix2 = new IntegerMatrixPublic();
matrix2.setGrid(grid1);
assertThrows(InvalidGeometryException.class, () -> {
matrix2.laplaceExpansionHelper(0, 0);
});
IntegerMatrixPublic matrix3 = new IntegerMatrixPublic();
matrix3.setGrid(grid2);
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(-1, 0);
});
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(2, 0);
});
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(0, -1);
});
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(0, 2);
});
}
private class IntegerMatrixPublic extends IntegerMatrix{
}
}