public void ShouldSplitOutlayMoneyAccordingToRatio() { var venture = new Venture(new Name("venture-name"), new Amount(100), new Amount(10)); var firstVentureName = new Name("new-venture-1"); var secondVentureName = new Name("new-venture-2"); var percentage = new Percentage(0.2f); var terms = new TermsOfSplit(percentage, firstVentureName, secondVentureName); venture.AddOffer(new Investor(new Name("testName"), new Amount(1000)), new Amount(100)); venture.Start(); var ventures = venture.Split(terms); Assert.AreEqual(percentage.Apply(venture.Outlay), ventures.First().Outlay); Assert.AreEqual(percentage.ApplyRemaining(venture.Outlay), ventures.Last().Outlay); }
public void ShouldBeAbleToApplyRemainingPercentage() { var percentage = new Percentage(0.4f); Assert.AreEqual(new Amount(60.0f).Denomination, percentage.ApplyRemaining(new Amount(100)).Denomination,0.1f); }