/// <summary> /// Gets the production bonus multiplier. /// </summary> /// <param name="protein"></param> /// <param name="unitTime">The overall unit completion time.</param> /// <returns>The production bonus multiplier.</returns> public static double GetBonusMultiplier(this Protein protein, TimeSpan unitTime) { return(ProductionCalculator.GetBonusMultiplier(protein.KFactor, protein.PreferredDays, protein.MaximumDays, unitTime)); }
public void ProductionCalculator_GetBonusMultiplier_Test() { var unitTime = TimeSpan.FromMinutes(5 * 100); Assert.AreEqual(19.5, ProductionCalculator.GetBonusMultiplier(26.4, 3.0, 5.0, unitTime), 0.01); }
public void ProductionCalculator_GetBonusMultiplier_ReturnsOneWhenUnitTimeIsZero_Test() { var unitTime = TimeSpan.Zero; Assert.AreEqual(1.0, ProductionCalculator.GetBonusMultiplier(26.4, 3.0, 5.0, unitTime), 0.01); }
public void ProductionCalculator_GetBonusMultiplier_ReturnsOneWhenUnitTimeGreaterThanPreferredTime_Test() { var unitTime = TimeSpan.FromDays(4); Assert.AreEqual(1.0, ProductionCalculator.GetBonusMultiplier(26.4, 3.0, 5.0, unitTime), 0.01); }
public void ProductionCalculator_GetBonusMultiplier_ReturnsOneWhenKFactorIsZero_Test() { var unitTime = TimeSpan.FromMinutes(5 * 100); Assert.AreEqual(1.0, ProductionCalculator.GetBonusMultiplier(0, 3.0, 5.0, unitTime), 0.01); }