Пример #1
0
        public void IsThereAnyEmptyFieldTest()
        {
            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.Fields[i, j] == null)
                    {
                        Assert.Fail(string.Format("Field doesn't have element on: {0}:{1}", i, j));
                    }
                }
            }
        }
Пример #2
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.");
        }
Пример #3
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");
        }