public void CanTerminateActivePolicyInTheMiddleOfCoverPeriod() { var offer = OfferFactory.NewOfferValidUntil(DateTime.Now.AddDays(5)); var policy = offer.Buy(PolicyHolderFactory.Abc()); var terminationResult = policy.Terminate(DateTime.Now.AddDays(3)); PolicyAssert .AssertThat(policy) .HasVersions(2) .HasVersion(2) .StatusIsTerminated(); PolicyVersionAssert .AssertThat(terminationResult.TerminalVersion) .TotalPremiumIs(180M); }
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); }