private void TestMatrix(int rows, int columns, int[,] expectedMatrix) { var generator = new MatrixGenerator(); var matrix = generator.GetMatrix(rows, columns); Assert.Equal(expectedMatrix.GetLength(0), matrix.GetLength(0)); Assert.Equal(expectedMatrix.GetLength(1), matrix.GetLength(1)); for (var i = 0; i < matrix.GetLength(0); i++) { for (var j = 0; j < matrix.GetLength(1); j++) { Assert.Equal(expectedMatrix[i, j], matrix[i, j]); } } }