public void GetAndSetAverageCrystalPriceTest() { //Przygotowanie GameParams g = new GameParams(); Functions f = new Functions(); Round r1 = new Round() { CrystalAveragePrevious = 0, CrystalPurchased = 1 }; Round r2 = new Round() { CrystalAveragePrevious = 0, CrystalPurchased = 0 }; Round r3 = new Round() { CrystalAveragePrevious = g.CrystalPriceConst + g.CrystalPrice, CrystalPurchased = 1, CrystalReserves = 1 }; Round r4 = new Round() { CrystalAveragePrevious = g.CrystalPriceConst + g.CrystalPrice, CrystalPurchased = 0, CrystalReserves = 1 }; double d1 = 0, d2 = 0, d3 = 0, d4 = 0; //Działanie d1 = f.GetAndSetAverageCrystalPrice(r1); d2 = f.GetAndSetAverageCrystalPrice(r2); d3 = f.GetAndSetAverageCrystalPrice(r3); d4 = f.GetAndSetAverageCrystalPrice(r4); //Sprawdzenie Assert.AreEqual(d1, g.CrystalPriceConst + g.CrystalPrice); Assert.AreEqual(d2, 0); Assert.AreEqual(d3, g.CrystalPriceConst + g.CrystalPrice); Assert.AreEqual(d4, 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); }