예제 #1
0
        public void DeleteReservationTestWithException()
        {
            ResetData();
            var uow = new Mock <UnitOfWork>();
            HotelReservationService hrs = new HotelReservationService(uow.Object);

            hrs.DeleteReservation(-5);
        }
예제 #2
0
        public void DeleteReservationTest()
        {
            ResetData();
            var uow = new Mock <UnitOfWork>();
            HotelReservationService hrs = new HotelReservationService(uow.Object);
            int numEx = uow.Object.HotelReservations.Get().Count - 1;

            HotelReservation reservation = uow.Object.HotelReservations.Get()[uow.Object.HotelReservations.Get().Count - 1];

            hrs.DeleteReservation(reservation.HotelReservationId);

            Assert.AreEqual(numEx, uow.Object.HotelReservations.Get().Count);
        }