Update test coverage

This commit is contained in:
2023-06-30 21:41:03 -04:00
parent 96fec9d7c2
commit 7efca4a154
9 changed files with 88 additions and 56 deletions

View File

@@ -1,7 +1,7 @@
//Matrix/src/test/java/com/mattrixwv/matrix/TestIntegerMatrix.java
//Mattrixwv
// Created: 02-01-22
//Modified: 04-13-23
//Modified: 06-30-23
package com.mattrixwv.matrix;
@@ -1852,19 +1852,19 @@ public class TestIntegerMatrix{
@Test
public void testLaplaceExpansionHelper(){
IntegerMatrixPublic matrix = new IntegerMatrixPublic();
IntegerMatrix matrix = new IntegerMatrix();
matrix.addRow(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix.laplaceExpansionHelper(0, 0);
});
IntegerMatrixPublic matrix2 = new IntegerMatrixPublic();
IntegerMatrix matrix2 = new IntegerMatrix();
matrix2.setGrid(grid1);
assertThrows(InvalidGeometryException.class, () -> {
matrix2.laplaceExpansionHelper(0, 0);
});
IntegerMatrixPublic matrix3 = new IntegerMatrixPublic();
IntegerMatrix matrix3 = new IntegerMatrix();
matrix3.setGrid(grid2);
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(-1, 0);
@@ -1878,9 +1878,16 @@ public class TestIntegerMatrix{
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(0, 2);
});
}
private class IntegerMatrixPublic extends IntegerMatrix{
IntegerMatrix matrix4 = new IntegerMatrix();
matrix4.addCol(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix4.laplaceExpansionHelper(0, 0);
});
matrix4.addCol(grid2[1]);
matrix4.addCol(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix4.laplaceExpansionHelper(0, 0);
});
}
}