public async Task CanCalculateNumberOfRemainingCycle()
        {
            var rp = new RecurringPayment
            {
                CycleLength    = 2,
                CyclePeriod    = RecurringProductCyclePeriod.Days,
                TotalCycles    = 3,
                StartDateUtc   = new DateTime(2010, 3, 1),
                CreatedOnUtc   = new DateTime(2010, 1, 1),
                IsActive       = true,
                InitialOrderId = 1
            };

            await _orderService.InsertRecurringPaymentAsync(rp);

            var cyclesRemaining = await _orderProcessingService.GetCyclesRemainingAsync(rp);

            cyclesRemaining.Should().Be(3);

            //add one history record
            await _orderService.InsertRecurringPaymentHistoryAsync(new RecurringPaymentHistory { RecurringPaymentId = rp.Id });

            cyclesRemaining = await _orderProcessingService.GetCyclesRemainingAsync(rp);

            cyclesRemaining.Should().Be(2);
            //add one more history record
            await _orderService.InsertRecurringPaymentHistoryAsync(new RecurringPaymentHistory { RecurringPaymentId = rp.Id });

            cyclesRemaining = await _orderProcessingService.GetCyclesRemainingAsync(rp);

            cyclesRemaining.Should().Be(1);
            //add one more history record
            await _orderService.InsertRecurringPaymentHistoryAsync(new RecurringPaymentHistory { RecurringPaymentId = rp.Id });

            cyclesRemaining = await _orderProcessingService.GetCyclesRemainingAsync(rp);

            cyclesRemaining.Should().Be(0);
            //add one more history record
            await _orderService.InsertRecurringPaymentHistoryAsync(new RecurringPaymentHistory { RecurringPaymentId = rp.Id });

            cyclesRemaining = await _orderProcessingService.GetCyclesRemainingAsync(rp);

            cyclesRemaining.Should().Be(0);
        }