Ejemplo n.º 1
0
        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.");
        }
Ejemplo n.º 2
0
        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");
        }