public void Redistribute_TotalWeightLessThanOne_RedistributedWeightIsAprroxOne() { var weights = new StockWeights { { "TLV", 0.1m }, { "FP", 0.2m }, { "EL", 0.3m } }; weights = weights.Redistribute(); Assert.IsTrue(weights.Sum(w => w.Value).IsApproxOne()); }
public void Redistribute_TotalWeightAlreadyOne_WeightsRemainUnchanged() { var weights = new StockWeights { { "TLV", 0.3m }, { "FP", 0.6m }, { "EL", 0.1m } }; weights = weights.Redistribute(); Assert.AreEqual(weights["TLV"], 0.3); Assert.AreEqual(weights["FP"], 0.6); Assert.AreEqual(weights["EL"], 0.1); }