public void when_initiating_payment_for_a_partially_reserved_order_then_redirects_back_to_seat_selection()
        {
            var seatTypeId = Guid.NewGuid();
            var seats      = new[] { new SeatType(seatTypeId, conferenceAlias.Id, "Test Seat", "Description", 10, 50) };

            Mock.Get(conferenceDao).Setup(r => r.GetPublishedSeatTypes(conferenceAlias.Id)).Returns(seats);

            var orderId      = Guid.NewGuid();
            var orderVersion = 10;

            Mock.Get(orderDao)
            .Setup(r => r.FindDraftOrder(orderId))
            .Returns(
                new DraftOrder(orderId, conferenceAlias.Id, DraftOrder.States.PartiallyReserved, orderVersion)
            {
                Lines = { new DraftOrderItem(seatTypeId, 10)
                          {
                              ReservedSeats = 5
                          } }
            });

            var result = (RedirectToRouteResult)sut.StartPayment(orderId, RegistrationController.ThirdPartyProcessorPayment, orderVersion - 1).Result;

            Assert.Equal(null, result.RouteValues["controller"]);
            Assert.Equal("StartRegistration", result.RouteValues["action"]);
            Assert.Equal(conferenceAlias.Code, result.RouteValues["conferenceCode"]);
            Assert.Equal(orderId, result.RouteValues["orderId"]);
            Assert.Equal(orderVersion, result.RouteValues["orderVersion"]);
        }
        public void GivenTheRegistrantProceedToCheckoutPayment()
        {
            var result = registrationController.SpecifyRegistrantAndPaymentDetails(
                registrationViewModel.RegistrantDetails,
                RegistrationController.ThirdPartyProcessorPayment, orderViewModel.OrderVersion).Result as RedirectToRouteResult;

            var timeout = DateTime.Now.Add(Constants.UI.WaitTimeout);

            while ((result == null || !result.RouteValues.ContainsKey("paymentId")) &&
                   DateTime.Now < timeout)
            {
                result = registrationController.StartPayment(registrationViewModel.RegistrantDetails.OrderId,
                                                             RegistrationController.ThirdPartyProcessorPayment, orderViewModel.OrderVersion).Result as RedirectToRouteResult;
            }

            Assert.NotNull(result);
            Assert.True(result.RouteValues.ContainsKey("paymentId"), "No 'paymentId' key, Checkout payment not completed");

            routeValues = result.RouteValues;
        }