public void BIInitializationTest() { BasicImprovement I = new BasicImprovement(10000, 0.1); Assert.AreEqual(0, I.NumberOfUpgrades); Assert.AreEqual(10000, I.StartingPrice); Assert.AreEqual(10000, I.CurrentPrice); Assert.AreEqual(0.1, I.SpeedOfAddingPoints); }
public void BIUpgradeTest() { BasicImprovement I = new BasicImprovement(10000, 0.1); // user level > improvement level I.Upgrade(); I.Upgrade(); // after double upgrade: Assert.AreEqual(2, I.NumberOfUpgrades); Assert.AreEqual(10000, I.StartingPrice); Assert.AreEqual(13225, I.CurrentPrice); Assert.AreEqual(0.1, I.SpeedOfAddingPoints); }
public void LoadBasicTechTree() { using (XmlReader reader = XmlReader.Create("ImprovementList.xml")) { while (reader.Read()) { if (reader.Name == "Row") { BasicImprovement improvement = new BasicImprovement(); improvement.name = reader.GetAttribute("A"); improvement.level = int.Parse(reader.GetAttribute("B")); improvement.category = reader.GetAttribute("C"); improvement.cost = float.Parse(reader.GetAttribute("D")); improvement.wealthUpkeep = float.Parse(reader.GetAttribute("E")); improvement.powerUpkeep = float.Parse(reader.GetAttribute("F")); improvement.influence = reader.GetAttribute("G"); improvement.details = reader.GetAttribute("H") + "\n" + reader.GetAttribute("I"); basicImprovementsList.Add(improvement); } } } }