public void TestUnitEmptyLoadout(UnitType type, int infuse, double expectedMinerals, double expectedKills) { var loadout = TestHelper.GetTestLoadout(); var cost = new UnitCostHelper(loadout).GetUnitCost(type, infuse, UnitRankType.None); Assert.That(cost.Minerals, Is.EqualTo(expectedMinerals)); Assert.That(cost.Kills, Is.EqualTo(expectedKills).Within(0.01)); }
public void TestUnitCostWithTWLoadout(UnitType type, int dw, int tw, double expected) { var loadout = TestHelper.GetTestLoadout() .AddDoubleWarp(dw) .AddTripleWarp(tw); var cost = new UnitCostHelper(loadout).GetUnitCost(type, 0, UnitRankType.None); Assert.That(cost.Minerals, Is.EqualTo(expected).Within(0.01)); }
public void TestVeterancy(UnitType unit, int infuse, int vet, double expectedCost) { var loadout = TestHelper.GetTestLoadout() .AddVeterancy(vet); var helper = new UnitCostHelper(loadout); var cost = helper.GetUnitCost(unit, infuse, UnitRankType.None).Kills; Assert.That(cost, Is.EqualTo(expectedCost).Within(1)); }
public void TestSpecUnitCost(UnitType unit, int specLevel, UnitType spec, bool hasAllSpec, double expectedCost) { var loadout = TestHelper.GetTestLoadout() .SetSpec(spec, specLevel, hasAllSpec); var helper = new UnitCostHelper(loadout); var cost = helper.GetUnitCost(unit, 0, UnitRankType.None); Assert.That(cost.Minerals, Is.EqualTo(expectedCost).Within(1)); }
[TestCase(UnitType.Dragoon, 0, 600, 250, -700 + 299)] //299 from rank C public void TestKillRecycleCacheUpgrade(UnitType unit, int infuse, int vet, int killRec, double expected) { var loadout = TestHelper.GetTestLoadout() .AddVeterancy(vet) .AddKillRecycle(killRec) .AddUpgradeCache(); var helper = new UnitCostHelper(loadout); var cost = helper.GetUnitCost(unit, infuse, UnitRankType.None).Kills; Assert.That(cost, Is.EqualTo(expected).Within(1)); }
public void TestDNAStart(UnitType unit, int infuse, int dnaStart, double expectedMins, double expectedKills) { var loadout = TestHelper.GetTestLoadout() .AddVeterancy(200) .AddDNAStartLevel(dnaStart); var helper = new UnitCostHelper(loadout); var cost = helper.GetUnitCost(unit, infuse, UnitRankType.None); Assert.That(cost.Minerals, Is.EqualTo(expectedMins).Within(1)); Assert.That(cost.Kills, Is.EqualTo(expectedKills).Within(1)); }
public void TestQuickStart(UnitType unit, int infuse, int qsCharges, int vet, double expectedMins, double expectedKills) { var loadout = TestHelper.GetTestLoadout() .AddVeterancy(vet) .AddQuickStartCharges(qsCharges); var helper = new UnitCostHelper(loadout); var cost = helper.GetUnitCost(unit, infuse, UnitRankType.None); Assert.That(cost.Minerals, Is.EqualTo(expectedMins).Within(1)); Assert.That(cost.Kills, Is.EqualTo(expectedKills).Within(1)); }
public void TestResourcesPerWaveForBrutas(RoomNumber room, DifficultyLevel diff, double expectedMinerals, double expectedKills) { var loadout = TestHelper.GetTestLoadout(); loadout.SetDifficulty(diff); loadout.SetFarmRoom(room); var calc = new IncomeCalculator(loadout); Assert.That(calc.GetMineralsPerMinute(), Is.EqualTo(expectedMinerals).Within(0.1)); Assert.That(calc.GetKillsPerMinute(), Is.EqualTo(expectedKills).Within(0.1)); }
public void MaxModScore(int expectedScore, DifficultyLevel diff) { var loadout = TestHelper.GetTestLoadout(); loadout.UnitConfiguration.DifficultyLevel = diff; foreach (var mod in loadout.Mods.AllMods) { mod.CurrentLevel = mod.MaxValue; } ((ModsCollection)loadout.Mods).PreventRoundingModscoreForTest = true; Assert.That(loadout.Mods.TotalModScore, Is.EqualTo(expectedScore)); }
public void TestDNAStartCacheUpgrade(UnitType unit, int inf, double expectedMinerals, double expectedKills) { var loadout = TestHelper.GetTestLoadout() .AddBlackMarket() .AddDNAStartLevel(5) .AddUpgradeCache(); var helper = new UnitCostHelper(loadout); var cost = helper.GetUnitCost(unit, inf, UnitRankType.None); Assert.That(cost.Kills, Is.EqualTo(expectedKills).Within(1)); Assert.That(cost.Minerals, Is.EqualTo(expectedMinerals)); }
public void TestBlackMarket(UnitType unit, int infuse, int vet, int infRec, int killRec, int dnaStart, double expectedMins, double expectedKills) { var loadout = TestHelper.GetTestLoadout() .AddVeterancy(vet) .AddBlackMarket() .AddKillRecycle(killRec) .AddInfuseRecycle(infRec) .AddDNAStartLevel(dnaStart); var helper = new UnitCostHelper(loadout); var cost = helper.GetUnitCost(unit, infuse, UnitRankType.None); Assert.That(cost.Minerals, Is.EqualTo(expectedMins).Within(1)); Assert.That(cost.Kills, Is.EqualTo(expectedKills).Within(1)); }
public void TestWeaponDamage(UnitType unit, double expectedDamage) { var loadout = TestHelper.GetTestLoadout(); loadout.UnitConfiguration.DifficultyLevel = DifficultyLevel.Hell; loadout.Upgrades.AttackUpgrade = 100; loadout.Upgrades.AttackSpeedUpgrade = 15; loadout.Gems.AttackGem.CurrentLevel = 200; loadout.Gems.AttackSpeedGem.CurrentLevel = 100; loadout.Units.Add(VUnit.New(unit, loadout)); loadout.CurrentUnit.CurrentInfusion = 5; loadout.CurrentUnit.EssenceStacks = 2500; loadout.CurrentUnit.UnitRank = UnitRankType.XX; Assert.That(loadout.Stats.Damage, Is.EqualTo(expectedDamage).Within(1)); }
public void TestDamageReduction(short specPerks, int statsDR, short rankDr, double otherDr, double expectedDR) { var loadout = TestHelper.GetTestLoadout(); loadout.CurrentUnit = VUnit.New(UnitType.WarpLord, loadout); loadout.UnitSpec = UnitType.WarpLord; var perks = (PerkCollection)loadout.Perks; perks.UnitSpecialization.DesiredLevel = specPerks; perks.DamageReduction.DesiredLevel = (short)(statsDR > 10 ? 10 : statsDR); perks.DamageReduction2.DesiredLevel = (short)(statsDR < 10 ? 0 : statsDR - 10); loadout.CurrentUnit.UnitRank = (UnitRankType)rankDr; loadout.Stats.UpdateDamageReduction("OTHER", otherDr); Assert.That(loadout.Stats.DamageReductionForBinding, Is.EqualTo(expectedDR)); }
public void TestAllUnitsHaveCost() { var loadout = TestHelper.GetTestLoadout(); var helper = new UnitCostHelper(loadout); var units = Enums.GetValues <UnitType>(); foreach (var unit in units) { helper.ResetCalculationVariables(); if (unit == UnitType.None) { continue; } var infuse = UnitType.Artifact == unit ? 0 : 5; var cost = helper.GetUnitCost(unit, infuse, UnitRankType.None); Assert.That(cost.Minerals, Is.GreaterThan(0)); Assert.That(cost.Kills, Is.GreaterThan(0)); } }