public IEnumerator JSONWriteTest() { UpgradeSystem upgradeSystem = new UpgradeSystem(); Upgrade testUpgrade = new Upgrade("Bomb Count", 1); upgradeSystem.AddUpgrade(testUpgrade); testUpgrade = new Upgrade("Speed", 2); upgradeSystem.AddUpgrade(testUpgrade); testUpgrade = new Upgrade("Range", 5); upgradeSystem.AddUpgrade(testUpgrade); UpgradeSystem.SaveUpgrades(upgradeSystem.GetUpgradeList()); yield return(null); }
public IEnumerator UpgradeObjectRetrievalTest() { UpgradeSystem upgradeSystem = new UpgradeSystem(); Upgrade testUpgrade = new Upgrade("Attack", 1); upgradeSystem.AddUpgrade(testUpgrade); Upgrade testUpgrade2 = upgradeSystem.GetUpgrade("Attack"); Assert.AreEqual("Attack", testUpgrade2.GetUpgradeName()); yield return(null); }
public IEnumerator UpgradeSystemObjectCreationTest() { UpgradeSystem upgradeSystem = new UpgradeSystem(); int listCount = upgradeSystem.GetUpgradeCount(); Assert.AreEqual(listCount, 0); Upgrade testUpgrade = new Upgrade("Attack", 1); upgradeSystem.AddUpgrade(testUpgrade); listCount = upgradeSystem.GetUpgradeCount(); Assert.AreEqual(listCount, 1); yield return(null); }
public IEnumerator JSONWriteTest() { UpgradeSystem upgradeSystem = new UpgradeSystem(); Upgrade testUpgrade = new Upgrade("Attack", 1); upgradeSystem.AddUpgrade(testUpgrade); /*testUpgrade = new Upgrade("Speed", 2); * upgradeSystem.AddUpgrade(testUpgrade); * testUpgrade = new Upgrade("Range", 5); * upgradeSystem.AddUpgrade(testUpgrade);*/ upgradeSystem.SaveUpgrades(); yield return(null); }
public IEnumerator UpgradeLevelTest() { UpgradeSystem upgradeSystem = new UpgradeSystem(); Upgrade testUpgrade = new Upgrade("Attack", 1); upgradeSystem.AddUpgrade(testUpgrade); int upgradeLevel = upgradeSystem.GetUpgrade("Attack").GetUpgradeLevel(); upgradeSystem.GetUpgrade("Attack").IncreaseLevel(); Assert.AreNotEqual(upgradeLevel, upgradeSystem.GetUpgrade("Attack").GetUpgradeLevel()); upgradeLevel = upgradeSystem.GetUpgrade("Attack").GetUpgradeLevel(); upgradeSystem.GetUpgrade("Attack").SetLevel(0); Assert.AreNotEqual(upgradeLevel, upgradeSystem.GetUpgrade("Attack").GetUpgradeLevel()); yield return(null); }