public void AddObjectTest() { IField lab = new Labyrinth(7); GameObject obj = new GameObject('$', 3, 3); lab.AddObject(obj); var expected = '$'; var actual = lab[3, 3]; Assert.AreEqual(expected, actual); }
public void AddObjectFailTest() { Labyrinth lab = new Labyrinth(7); GameObject obj = new GameObject('$', 0, 1); char[,] testMatrix = new char[,] { {'-', 'X', '-', 'X'}, {'-', '-', '-', 'X'}, {'X', 'X', '-', '-'} , {'X', 'X', '-', '-'} }; lab.TestMatrix(testMatrix); lab.AddObject(obj); var expected = 'X'; var actual = lab[0, 1]; Assert.AreEqual(expected, actual); }