AcceptOffer() public method

public AcceptOffer ( Offer offer ) : void
offer Offer
return void
コード例 #1
0
ファイル: InvestorTest.cs プロジェクト: bagheera/Gringotts
 public void ShouldBeAbleToAcceptOffer()
 {
     var investor = new Investor(new Name("Inverstor1"), new Amount(1000));
     var venture = new Venture(new Name("venture1"), new Amount(1000), new Amount(500));
     investor.AcceptOffer(new Offer(investor, new Amount(600), venture));
 }
コード例 #2
0
ファイル: Venture.cs プロジェクト: bagheera/Gringotts
 public virtual Offer AddOffer(Investor investor, Amount investedAmount)
 {
     if (Subscription.AlreadyInvested(investor))
         throw new InvalidOfferException("Cannot invest more than once.");
     if (!MinimumInvestment(investedAmount))
         throw new InvalidOfferException("Investment amount less than the required minimum amount.");
     Offer offer = new Offer(investor, investedAmount, this);
     investor.AcceptOffer(offer);
     Subscription.Add(offer);
     return offer;
 }
コード例 #3
0
ファイル: InvestorTest.cs プロジェクト: jskswamy/Gringotts
 public void Should_Be_Able_ToAccept_Offer()
 {
     Investor investor = new Investor(new Name("Inverstor1"), new GringottsDate(DateTime.Now), new Amount(1000));
     investor.AcceptOffer(new Offer(investor, new Amount(600), null));
 }