public void SubtractOperatorWorks() { RegeneratingBank bank = new RegeneratingBank { Quantity = 4 }; Assert.IsTrue(bank - 2 == 2, "- operator does not work properly"); }
public void PlusOperatorWorks() { RegeneratingBank bank = new RegeneratingBank { Quantity = 4, }; Assert.IsTrue(bank + 2 == 6, "+ operator does not work properly"); }
public void ImplicitOperatorIntExists() { RegeneratingBank bank = new RegeneratingBank { Quantity = 4 }; int hi = bank; Assert.IsTrue(hi == (int)4, "Something went wrong with the conversion"); }
public void ImplicitOperatorStringExists() { RegeneratingBank bank = new RegeneratingBank { Quantity = 4 }; string amt = bank; Assert.IsTrue(amt == "4", "Something went wrong with the conversion"); }
public ProductionBaySlot(RegeneratingBank pool, RegeneratingBank reserve, ResourceBank resources, uint seats) { Pool = pool; Reserve = reserve; Resources = resources; Workers = new CappedList <Citizen>(seats); WorkPairings = new Dictionary <Citizen, Ingredient <Resource> >( ); Lineup = new List <Recipe <Resource, Resource> >( ); }
public void FailsOnDecayTooLarge() { RegeneratingBank bank = new RegeneratingBank { Quantity = 4, DecayRate = 5, }; bool worked = false; bank.Decay(() => worked = true); Assert.IsTrue(worked); }
public void RegenRespectsCapacity() { RegeneratingBank bank = new RegeneratingBank { Quantity = 4, Maximum = 5, RegenRate = 5 }; bank.Regen( ); Assert.IsTrue(bank == 5, "Does not respect capacity"); }
public void DecayWorks() { RegeneratingBank bank = new RegeneratingBank { Quantity = 4, DecayRate = 2 }; bank.Decay(onFailure: () => { Assert.Fail("Not enough energy. Something is wrong with the Quantity."); }); Assert.IsTrue(bank == 2); }
public void RegenWorks() { RegeneratingBank bank = new RegeneratingBank { Quantity = 4, Maximum = 10, RegenRate = 4 }; bank.Regen(1); Assert.IsTrue(bank == 5); bank.Regen( ); Assert.IsTrue(bank == 9, "Does not respect default regeneration value"); }
/// <summary> /// Create a new ProductionBaySlot limiting the quantity of seats. /// </summary> /// <param name="pool">The pool of the ProductionBay</param> /// <param name="reserve">The reserve of the ProductionBay</param> /// <param name="resources"The ResourceBank of the ProductionBay></param> /// <param name="seats">The maximum amount of workers in the station</param> /// <param name="workers">The list of workers to grab from</param> /// <remarks>Note: If the list of workers is larger than the seat count, it'll just grab the first 'seats' quantity of workers</remarks> public ProductionBaySlot(RegeneratingBank pool, RegeneratingBank reserve, ResourceBank resources, uint seats, List <Citizen> workers)