public void TestMethod1() { // Arrange Matrix01 question = new Matrix01(); int[,] matrix = new int[, ] { { 0, 0, 0 }, { 0, 1, 0 }, { 0, 0, 0 } }; int[,] expected = new int[, ] { { 0, 0, 0 }, { 0, 1, 0 }, { 0, 0, 0 } }; // Act int[,] actual = question.UpdateMatrix(matrix); // Assert CollectionAssert.AreEqual(expected, actual); }
public void testMatrix() { Matrix01 matrixtest = new Matrix01(); int[][] expected = new int[][] { new int[] { 0, 0, 0 }, new int[] { 0, 1, 0 }, new int[] { 1, 2, 1 } }; int[][] result = matrixtest.UpdateMatrix(new int[][] { new int[] { 0, 0, 0 }, new int[] { 0, 1, 0 }, new int[] { 1, 1, 1 } }); for (int i = 0; i < result.Length; i++) { for (int j = 0; j < result[i].Length; j++) { Assert.AreEqual(expected[i][j], result[i][j]); } } }