public void CanCreateOfferOnBehalfOfAgentBasedOnPrice() { var price = new Price(new Dictionary <string, decimal>() { ["C1"] = 100M, ["C2"] = 200M }); var offer = Offer.ForPriceAndAgent ( "P1", DateTime.Now, DateTime.Now.AddDays(5), null, price, "jimmy.son" ); OfferAssert .AssertThat(offer) .ProductCodeIs("P1") .StatusIsNew() .PriceIs(300M) .AgentIs("jimmy.son"); }
public void CanBuyNewNonExpiredOffer() { var offer = OfferFactory.NewOfferValidUntil(DateTime.Now.AddDays(5)); var policy = offer.Buy(PolicyHolderFactory.Abc()); OfferAssert .AssertThat(offer) .StatusIsConverted(); PolicyAssert .AssertThat(policy) .StatusIsActive() .HasVersions(1) .HasVersion(1); PolicyVersionAssert .AssertThat(policy.Versions.WithNumber(1)) .TotalPremiumIs(offer.TotalPrice); }