Updated libraries and increased test coverage
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//Matrix/src/test/java/com/mattrixwv/matrix/TestBigBigIntegerMatrix.java
|
||||
//Mattrixwv
|
||||
// Created: 02-10-22
|
||||
//Modified: 07-09-22
|
||||
//Modified: 04-13-23
|
||||
package com.mattrixwv.matrix;
|
||||
|
||||
|
||||
@@ -200,8 +200,8 @@ public class TestBigIntegerMatrix{
|
||||
public void testEquals(){
|
||||
//Invalid equals
|
||||
BigIntegerMatrix matrix = new BigIntegerMatrix(grid1);
|
||||
assertNotEquals(null, matrix);
|
||||
assertNotEquals(new int[0], matrix);
|
||||
assertNotEquals(matrix, null);
|
||||
assertNotEquals(matrix, new int[0]);
|
||||
|
||||
//1x1
|
||||
boolean gridEquals = matrix.equals(matrix);
|
||||
@@ -1858,4 +1858,38 @@ public class TestBigIntegerMatrix{
|
||||
String matrixString = "[1,2,3]\n[1,2,3]\n[1,2,3]";
|
||||
assertEquals(matrixString, matrix.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLaplaceExpansionHelper(){
|
||||
BigIntegerMatrixPublic matrix = new BigIntegerMatrixPublic();
|
||||
matrix.addRow(grid2[0]);
|
||||
assertThrows(InvalidGeometryException.class, () -> {
|
||||
matrix.laplaceExpansionHelper(0, 0);
|
||||
});
|
||||
|
||||
BigIntegerMatrixPublic matrix2 = new BigIntegerMatrixPublic();
|
||||
matrix2.setGrid(grid1);
|
||||
assertThrows(InvalidGeometryException.class, () -> {
|
||||
matrix2.laplaceExpansionHelper(0, 0);
|
||||
});
|
||||
|
||||
BigIntegerMatrixPublic matrix3 = new BigIntegerMatrixPublic();
|
||||
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 BigIntegerMatrixPublic extends BigIntegerMatrix{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user