예제 #1
0
        public void AddFoodTest()
        {
            var eatMatrix = new FoodMatrix(2, 2, new FillingFromCornersByWavesStrategy());
            var point     = new Point(0, 0);

            FrequentlyUsedMethods.RaiseFoodLevelToConstantWithAddFood(eatMatrix, point, CreatureConstants.OneBite);

            Assert.IsTrue(eatMatrix.HasOneBite(point));
        }
예제 #2
0
        public void HasMaxFoodLevelIsTrueTest()
        {
            var eatMatrix = new FoodMatrix(2, 2, new FillingFromCornersByWavesStrategy());
            var point     = new Point(0, 0);

            FrequentlyUsedMethods.RaiseFoodLevelToConstantWithAddFood(eatMatrix, point, FoodMatrixConstants.MaxFoodLevel);

            Assert.IsTrue(eatMatrix.HasMaxFoodLevel(point));
        }
예제 #3
0
        public void TakeFoodIsTrueTest()
        {
            var eatMatrix = new FoodMatrix(2, 2, new FillingFromCornersByWavesStrategy());
            var point     = new Point(0, 0);

            FrequentlyUsedMethods.RaiseFoodLevelToConstantWithAddFood(eatMatrix, point, CreatureConstants.OneBite);

            Assert.IsTrue(eatMatrix.HasOneBite(point));

            var counter = FoodMatrixConstants.AddedFoodLevel / CreatureConstants.OneBite;

            for (int i = 0; i < counter; i++)
            {
                Assert.IsTrue(eatMatrix.TakeFood(point));
            }

            Assert.IsFalse(eatMatrix.HasOneBite(point));
        }