コード例 #1
0
        public void CanExtendCoverageWithMiddleDayOfPolicy()
        {
            var product = ProductsTestData.StandardCarInsurance();
            var policy  = PolicyTestData.StandardOneYearPolicy(new DateTime(2019, 1, 1));

            var newCover = product.Covers.WithCode("AC");

            policy.ExtendCoverage
            (
                new DateTime(2019, 7, 1),
                new CoverPrice(Guid.NewGuid(), newCover, Money.Euro(100), TimeSpan.FromDays(365))
            );

            Equal(2, policy.Versions.Count());
            Equal(Money.Euro(500), policy.Versions.WithNumber(1).TotalPremium);
            Equal(PolicyVersionStatus.Active, policy.Versions.WithNumber(1).VersionStatus);
            Equal(Money.Euro(550.41), policy.Versions.WithNumber(2).TotalPremium);
            Equal(PolicyVersionStatus.Draft, policy.Versions.WithNumber(2).VersionStatus);
            Equal(PolicyVersionStatus.Draft, policy.Versions.WithNumber(2).VersionStatus);
        }
コード例 #2
0
        public static Offer StandardOneYearOCOfferValidUntil(DateTime validityEnd)
        {
            var product = ProductsTestData.StandardCarInsurance();

            return(new Offer
                   (
                       Guid.NewGuid(),
                       "1",
                       product,
                       PersonsTestData.Kowalski(),
                       PersonsTestData.Kowalski(),
                       CarsTestData.OldFordFocus(),
                       TimeSpan.FromDays(365),
                       Money.Euro(500),
                       validityEnd.AddDays(-30),
                       new Dictionary <Cover, Money>()
            {
                { product.Covers.WithCode("OC"), Money.Euro(500) }
            }
                   ));
        }