Ejemplo n.º 1
0
        public void EndTurn_FoodProduced(int farmCount, int expectedAmount)
        {
            int nonRandomAmount = Convert.ToInt32(farmCount * endTurnSettings.FoodProductionRate);

            mockRandomizer.Setup(x => x.GetRandomizedAmount(nonRandomAmount)).Returns(expectedAmount);

            var endTurnPackage = new EndTurnPackage {
                FarmCount = farmCount
            };

            endTurnCalculator.EndTurn(endTurnPackage);

            Assert.That(endTurnCalculator.FoodProduced, Is.EqualTo(expectedAmount));
        }
Ejemplo n.º 2
0
        public void EndTurn()
        {
            endTurnCalculator.EndTurn(GetEndTurnPackage());

            PeasantCount += endTurnCalculator.PeasantsGained;
            PeasantCount -= endTurnCalculator.PeasantsLost;
            FoodCount    += endTurnCalculator.FoodProduced;
            FoodCount    -= endTurnCalculator.FoodConsumed;

            treasury.Deposit(endTurnCalculator.TaxIncome);
            economy.InflateCosts();

            Turn++;
        }