Example #1
0
        public void CountResourcesExpenseTest()
        {
            //Przygotowanie
            GameParams g  = new GameParams();
            Functions  f  = new Functions();
            Round      r1 = new Round()
            {
                WoodPurchased = g.WoodAmountLow
            };
            Round r2 = new Round()
            {
                CrystalPurchased = 1
            };
            Round r3 = new Round()
            {
                WoodPurchased = g.WoodAmountLow, CrystalPurchased = 1
            };
            double d1 = 0, d2 = 0, d3 = 0;

            //Działanie
            d1 = f.CountResourcesExpense(r1);
            d2 = f.CountResourcesExpense(r2);
            d3 = f.CountResourcesExpense(r3);
            //Sprawdzenie
            Assert.AreEqual(d1, f.GetTotalWoodPrice(r1));
            Assert.AreEqual(d2, f.GetTotalCrystalPrice(r2));
            Assert.AreEqual(d3, f.GetTotalWoodPrice(r1) + f.GetTotalCrystalPrice(r2));
        }
Example #2
0
        public void GetTotalCrystalPriceTest()
        {
            //Przygotowanie
            GameParams g  = new GameParams();
            Functions  f  = new Functions();
            Round      r1 = new Round()
            {
                CrystalPurchased = 1
            };
            Round r2 = new Round()
            {
                CrystalPurchased = 100
            };
            double d1 = 0, d2 = 0;

            //Działanie
            d1 = f.GetTotalCrystalPrice(r1);
            d2 = f.GetTotalCrystalPrice(r2);
            //Sprawdzenie
            Assert.AreEqual(d1, g.CrystalPriceConst + g.CrystalPrice);
            Assert.AreEqual(d2, g.CrystalPriceConst + (g.CrystalPrice * 100));
        }