Пример #1
0
        public void GetCrystalUseTest()
        {
            //Przygotowanie
            GameParams g  = new GameParams();
            Functions  f  = new Functions();
            Round      r1 = new Round()
            {
                WandsAmount = 0
            };
            Round r2 = new Round()
            {
                WandsAmount = 1
            };
            Round r3 = new Round()
            {
                WandsAmount = 1000
            };
            double d1 = 0, d2 = 0, d3 = 0;

            //Działanie
            d1 = f.GetCrystalUse(r1);
            d2 = f.GetCrystalUse(r2);
            d3 = f.GetCrystalUse(r3);
            //Sprawdzenie
            Assert.AreEqual(d1, 0 * g.CrystalConsumption);
            Assert.AreEqual(d2, 1 * g.CrystalConsumption);
            Assert.AreEqual(d3, 1000 * g.CrystalConsumption);
        }
Пример #2
0
        public void GetGeneralMaterialRateCostTest()
        {
            //Przygotowanie
            GameParams g  = new GameParams();
            Functions  f  = new Functions();
            Round      r1 = new Round()
            {
                WandsAmount = 1000, WoodPurchased = 2000, CrystalPurchased = 1000
            };
            double d1 = 0;

            //Działanie
            d1 = f.GetGeneralMaterialRateCost(r1);
            //Sprawdzenie
            Assert.AreEqual(d1, (f.GetWoodUse(r1) * f.GetAndSetAverageWoodPrice(r1) * f.GetCrystalUse(r1) * f.GetAndSetAverageCrystalPrice(r1)) * g.GeneralMaterialRateCosts);
        }