Ejemplo n.º 1
0
        public void AddReservationsHavingUnpayedThrowsException()
        {
            Reservation r1 = new Reservation()
            {
                ReservationDate = DateTime.Now.AddMonths(-1)
            };
            Reservation r2 = new Reservation()
            {
                ReservationDate = DateTime.Now
            };

            using (IUnitOfWork unitOfWork = GetContext())
            {
                using (ReservationManagement reservationManagement = new ReservationManagement(unitOfWork, TestHelper.GetGenericPrincipalAdmin(), Mapper.Instance))
                {
                    reservationManagement.Add(r1);
                    Assert.Throws <BussinesException>(() => reservationManagement.Add(r2));
                }
            }
        }