public void Q1_6() { int[,] matrix = new int[, ] { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; DataStruct.Q6_Rotate(matrix); int[,] expectedAnswer = new int[, ] { { 7, 4, 1 }, { 8, 5, 2 }, { 9, 6, 3 } }; Assert.AreEqual(matrix.Rank, expectedAnswer.Rank); foreach (int dimension in Enumerable.Range(0, matrix.Rank)) { Assert.AreEqual(matrix.GetLength(dimension), expectedAnswer.GetLength(dimension)); } Assert.IsTrue(matrix.Cast <int>().SequenceEqual(expectedAnswer.Cast <int>())); }