public void MinOrderValueCutOffStrategy_AsExpected() { var toBuyAmount = 2070.2175m; var(currentWeights, targetWeights, portfolioValue) = TestResources.ReadWeights(); var strategy = new MinOrderValueCutOffStrategy(new FollowTargetAdjustmentStrategy(), MIN_ORDER_VALUE / toBuyAmount); var adjustedWeights = strategy.AdjustWeights(currentWeights, targetWeights, portfolioValue / toBuyAmount); Assert.IsTrue(adjustedWeights.Sum(w => w.Value).IsApproxOne()); }
public void FollowTargetAdjustmentStrategy_AsExpected() { var toBuyAmount = 2000m; var(currentWeights, targetWeights, portfolioValue) = TestResources.ReadWeights(); var strategy = new FollowTargetAdjustmentStrategy(); var adjustedWeights = strategy.AdjustWeights(currentWeights, targetWeights, portfolioValue / toBuyAmount); Assert.IsTrue(adjustedWeights.Sum(w => w.Value).IsApproxOne()); }