public void ExpendEnergy_ErrorsIfNotEnoughEnergy() { ProductionBaySlot slot = new ProductionBaySlot( new RegeneratingBank { Maximum = 1000, Quantity = 0 }, new RegeneratingBank { Maximum = 100, Quantity = 20 }, null, 0); Assert.ThrowsException <NotEnoughEnergyException>(() => slot.ExpendEnergy(1000)); }
public void ExpendEnergy_TakesFromPoolFirst() { ProductionBaySlot slot = new ProductionBaySlot( new RegeneratingBank { Maximum = 1000, Quantity = 8 }, new RegeneratingBank { Maximum = 10, Quantity = 10 }, null, 0); slot.ExpendEnergy(10, () => Assert.Fail("Should not error.")); }
public void ExpendEnergy_TakesFromReserveIfPoolEmpty() { ProductionBaySlot slot = new ProductionBaySlot( new RegeneratingBank { Maximum = 1000, Quantity = 0 }, new RegeneratingBank { Maximum = 100, Quantity = 20 }, null, 0); slot.ExpendEnergy(10); Assert.IsTrue(slot.Reserve == 10, $"Expected slot.Reserve to be 10, actually {slot.Reserve}"); }