public DistributeDividends ( |
||
amount | ||
리턴 | void |
public void DistributeDividends(Amount amount)
{
Dictionary<Investment, Amount> participation = CalculateParticipation();
foreach (var participant in participation)
{
participant.Key.GiveReturn(participant.Key.Venture, participant.Value * amount);
}
}
public void Should_Be_Able_To_Calculate_Participation() { Holding holding = new Holding(); holding.Add(new Investment(new Investor(new Name("quarter"), new GringottsDate(DateTime.Now), new Amount(1500)), null, new Amount(250))); holding.Add(new Investment(new Investor(new Name("threeFourths"), new GringottsDate(DateTime.Now), new Amount(1000)), null, new Amount(750))); holding.DistributeDividends(new Amount(1000)); }