Exemple #1
0
        public void OverlappingBookingExist_BookingStartsBeforeAndFinishesAfterAnExistingBooking_ReturnExistingBookingRefrence()
        {
            //Act
            var result = BookingHelper.OverlappingBookingExist(new Booking()
            {
                Id            = 1,
                ArrivalDate   = Before(_existingBooking.ArrivalDate),
                DepartureDate = After(_existingBooking.DepartureDate)
            }, _bookRepository.Object);

            //Assert
            Assert.That(result, Is.EqualTo(_existingBooking.Reference));
        }
Exemple #2
0
        public void OverlappingBookingExist_BookingStartsAndFinishesBeforeAnExistingBooking_ReturnEmptyString()
        {
            //Act
            var result = BookingHelper.OverlappingBookingExist(new Booking()
            {
                Id            = 1,
                ArrivalDate   = Before(_existingBooking.ArrivalDate, days: 2),
                DepartureDate = Before(_existingBooking.ArrivalDate)
            }, _bookRepository.Object);



            //Assert
            Assert.That(result, Is.Empty);
        }
Exemple #3
0
        public void OverlappingBookingExist_NewBookingIsCancelled_ReturnEmptyString()
        {
            //Act
            var result = BookingHelper.OverlappingBookingExist(new Booking()
            {
                Id            = 1,
                ArrivalDate   = After(_existingBooking.DepartureDate),
                DepartureDate = After(_existingBooking.ArrivalDate),
                Status        = "Cancelled"
            }, _bookRepository.Object);



            //Assert
            Assert.That(result, Is.Empty);
        }