Esempio n. 1
0
        public void Delete_Should_Delete_Reservation_With_Id_1()
        {
            ReservationRepository reservationRepository = new ReservationRepository();

            Reservation reservation = new Reservation
            {
                Firstnanme      = "John",
                Lastname        = "Smith",
                DepartureDate   = new DateTime(2017, 11, 1),
                ReturnDate      = new DateTime(2017, 11, 14),
                DepatureCity    = "London",
                DestinationCity = "New York"
            };

            reservationRepository.Save(reservation);

            reservationRepository.Delete(1);

            int expectedResult = 0;
            int actualResult   = reservationRepository.All().Count();

            Assert.AreEqual(expectedResult, actualResult);
        }
Esempio n. 2
0
        public void Delete_Should_Fail_Delete_Of_Reservation_With_Id_2()
        {
            ReservationRepository reservationRepository = new ReservationRepository();

            Assert.Throws <System.Exception>(() => reservationRepository.Delete(2));
        }