Ejemplo n.º 1
0
        public void WhenCreatePaymentPlanWithValidOrderAmount_ShouldReturnValidPaymentPlan()
        {
            // Arrange
            var paymentPlanFactory = new PaymentPlanFactory();

            // Act
            var paymentPlan = paymentPlanFactory.CreatePaymentPlan(123.45M);

            // Assert
            paymentPlan.ShouldNotBeNull();
        }
Ejemplo n.º 2
0
        public void WhenCreatePaymentPlanWithValidOrderAmount_ShouldReturnCorretNumberOfInstallments()
        {
            // Arrange
            var paymentPlanFactory = new PaymentPlanFactory(_config);

            // Act
            var paymentPlan = paymentPlanFactory.CreatePaymentPlan(123.45M);

            // Assert
            paymentPlan.Installments.Length.ShouldBe(4);
        }
Ejemplo n.º 3
0
        public void WhenCreatePaymentPlanWithValidOrderAmount_ShouldReturnCorretInstallmentDates()
        {
            // Arrange
            var paymentPlanFactory = new PaymentPlanFactory(_config);

            // Act
            var paymentPlan = paymentPlanFactory.CreatePaymentPlan(123.45M);

            // Assert
            paymentPlan.Installments[0].DueDate.Day.ShouldBeEquivalentTo(DateTime.Now.Day);
            paymentPlan.Installments[1].DueDate.Day.ShouldBeEquivalentTo(DateTime.Now.Add(new TimeSpan(14, 0, 0, 0)).Day);
            paymentPlan.Installments[2].DueDate.Day.ShouldBeEquivalentTo(DateTime.Now.Add(new TimeSpan(28, 0, 0, 0)).Day);
            paymentPlan.Installments[3].DueDate.Day.ShouldBeEquivalentTo(DateTime.Now.Add(new TimeSpan(42, 0, 0, 0)).Day);
        }
Ejemplo n.º 4
0
        public void WhenCreatePaymentPlanWithValidOrderAmount_ShouldReturnCorretInstallmentAmounts()
        {
            // Arrange
            var paymentPlanFactory = new PaymentPlanFactory(_config);

            // Act
            var paymentPlan = paymentPlanFactory.CreatePaymentPlan(123.45M);

            // Assert
            paymentPlan.Installments[0].Amount.ShouldBeEquivalentTo(30.8625M);
            paymentPlan.Installments[1].Amount.ShouldBeEquivalentTo(30.8625M);
            paymentPlan.Installments[2].Amount.ShouldBeEquivalentTo(30.8625M);
            paymentPlan.Installments[3].Amount.ShouldBeEquivalentTo(30.8625M);
        }