public void SimmetricSquareMatrix_Add_SimmetricSquareMatrix() { int[,] inputMatrixFirst = { { 4, 2, 3 }, { 2, 2, 5 }, { 3, 5, 2 } }; BaseMatrix <int> firstMatrix = new SimmetricSquareMatrix <int>(inputMatrixFirst); BaseMatrix <int> secondMatrix = new SimmetricSquareMatrix <int>(inputMatrixFirst); var resultSumm = firstMatrix.Add(secondMatrix); int[,] resultMatrix = { { 8, 4, 6 }, { 4, 4, 10 }, { 6, 10, 4 } }; var resultHelper = new SimmetricSquareMatrix <int>(resultMatrix); var helper = new HelperForSumm <int>(); Assert.IsTrue(helper.IsEqual(resultHelper, resultSumm)); }
public void DiagonalSquareMatrix_Add_DiagonalSquareMatrix() { int[,] inputMatrixFirst = { { 4, default(int), default(int) }, { default(int), 2, default(int) },{ default(int), default(int), 2 } }; BaseMatrix <int> firstMatrix = new DiagonalSquareMatrix <int>(inputMatrixFirst); BaseMatrix <int> secondMatrix = new DiagonalSquareMatrix <int>(inputMatrixFirst); var resultSumm = firstMatrix.Add(secondMatrix); int[,] resultMatrix = { { 8, 0, 0 }, { 0, 4, 0 }, { 0, 0, 4 } }; var resultHelper = new DiagonalSquareMatrix <int>(resultMatrix); var helper = new HelperForSumm <int>(); Assert.IsTrue(helper.IsEqual(resultHelper, resultSumm)); }