GenerateCofactorMatrix() public method

Creates the cofactor matrix corresponding to this matrix
public GenerateCofactorMatrix ( ) : Matrix
return Matrix
        public void Matrix_GenerateCofactorMatrixTest()
        {
            Matrix matrix1 = new Matrix(3,3);

            double[] matrix1Column1 = { 1, 5, 6 };
            double[] matrix1Column2 = { 2, 4, 7 };
            double[] matrix1Column3 = { 3, 6, 8 };

            matrix1.SetColumn(0, matrix1Column1);
            matrix1.SetColumn(1, matrix1Column2);
            matrix1.SetColumn(2, matrix1Column3);

            Matrix expectedResult = new Matrix(3,3);

            double[] expectedResultColumn1 = { -10, 5, 0 };
            double[] expectedResultColumn2 = { -4, -10, 9};
            double[] expectedResultColumn3 = { 11, 5, -6 };

            expectedResult.SetColumn(0, expectedResultColumn1);
            expectedResult.SetColumn(1, expectedResultColumn2);
            expectedResult.SetColumn(2, expectedResultColumn3);
            
            Matrix actualResult = matrix1.GenerateCofactorMatrix();

            bool equalityResult = (actualResult == expectedResult);

            equalityResult.Should().BeTrue();
        }