Ejemplo n.º 1
0
        public void PayForReservation()
        {
            var         profile = (ProfileDTO)profiles[0].Tag;
            SessionData data    = CreateNewSession(profile, ClientInformation);
            ScheduleEntryReservationDTO reservation = null;

            RunServiceMethod(delegate(InternalBodyArchitectService service)
            {
                ReservationsOperationParam param = new ReservationsOperationParam();
                param.CustomerId    = customers[0].GlobalId;
                param.EntryId       = entries[0].GlobalId;
                param.OperationType = ReservationsOperationType.Make;
                reservation         = service.ReservationsOperation(data.Token, param).Reservation;
            });



            var koszyk = new PaymentBasketDTO();

            koszyk.CustomerId = customers[0].GlobalId;
            koszyk.TotalPrice = 20m;
            var zakup = new PaymentDTO();

            zakup.Count   = 1;
            zakup.Product = reservation;
            koszyk.Payments.Add(zakup);

            RunServiceMethod(delegate(InternalBodyArchitectService service)
            {
                koszyk = service.PaymentBasketOperation(data.Token, koszyk);
            });
            Assert.AreEqual(koszyk.GlobalId, koszyk.Payments[0].PaymentBasketId);
            GetScheduleEntriesParam param1 = new GetScheduleEntriesParam();

            param1.EntryId = entries[0].GlobalId;
            RunServiceMethod(delegate(InternalBodyArchitectService service)
            {
                var entryData = service.GetScheduleEntries(data.Token, param1, new PartialRetrievingInfo());
                Assert.IsTrue(entryData.Items[0].Reservations.ElementAt(0).IsPaid);
            });
            var dbZakup = Session.Get <Payment>(koszyk.Payments[0].GlobalId);

            Assert.Greater(dbZakup.DateTime, DateTime.MinValue);
        }
 public InstructorEntryObjectBuilder(ScheduleEntryReservationDTO reservation, ScheduleEntryDTO scheduleEntry)
 {
     this.reservation   = reservation;
     this.scheduleEntry = scheduleEntry;
 }
Ejemplo n.º 3
0
 public ScheduleEntryReservationViewModel(ScheduleEntryReservationDTO reservation)
 {
     this.reservation = reservation;
 }