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)); }
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)); }
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)); }