public void IsThereAnyLiveElementFieldTest() { GuestlineMap map = new GuestlineMap(); map.RenderMap(); for (int i = 0; i < map.Fields.GetLength(0); i++) { for (int j = 0; j < map.Fields.GetLength(1); j++) { if (map.Hit(i, j) is HitResult) { return; } } } Assert.Fail("Map doesn't have any live element."); }
public void CountOfLiveElementFieldTest() { GuestlineMap map = new GuestlineMap(); map.RenderMap(); int count = 0; for (int i = 0; i < map.Fields.GetLength(0); i++) { for (int j = 0; j < map.Fields.GetLength(1); j++) { if (map.Hit(i, j) is HitResult) { count++; } } } Assert.AreEqual(13, count, "Number of living elements is incorrect"); }