Add() public method

public Add ( Investment investment ) : void
investment Investment
return void
Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
 public void Should_Be_Able_To_Distribute_Dividends_Fairly()
 {
     Amount profit = new Amount(1000);
     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(profit);
 }
Exemplo n.º 3
0
 public void ShouldBeAbleToCreateAndAddInvestmentsToHoldings()
 {
     var holding = new Holding();
     var investor = new Investor(new Name("investor"),  new Amount(50000));
     holding.Add(new Investment(investor, null, new Amount(100)));
 }
Exemplo n.º 4
0
 private Holding GetSplittedHolding(Percentage percentage)
 {
     var aHolding = new Holding();
     foreach (var investment in Investments)
     {
         Investment inv = new Investment(investment.Investor, percentage.Apply(investment.Value));
         aHolding.Add(inv);
         inv.Investor.AddInvestmentToPortfolio(inv);
     }
     return aHolding;
 }
Exemplo n.º 5
0
 public void Should_Be_Able_To_Create_And_Add_Investments_To_Holdings()
 {
     Holding holding = new Holding();
     Investor investor = new Investor(new Name("investor"), new GringottsDate(DateTime.Now), new Amount(50000));
     holding.Add(new Investment(investor, null, new Amount(100)));
 }