public void BookingStartsAndEndsDuringExistingBooking_ReturnsExistingBookingReference()
        {
            // Arrange
            var bookingCurrent = new Booking
            {
                Id            = 1,
                ArrivalDate   = After(_bookingExisting.ArrivalDate),
                DepartureDate = Before(_bookingExisting.DepartureDate)
            };

            // Act
            var result = BookingHelperWithDependencyInjection.OverlappingBookingsExist(bookingCurrent, _repository);

            // Assert
            result.ShouldBe(_bookingExisting.Reference);
        }
        BookingStartsAndEndsBeforeExistingBooking_ReturnsEmptyString()
        {
            // Arrange
            var bookingCurrent = new Booking
            {
                Id            = 1,
                ArrivalDate   = Before(_bookingExisting.ArrivalDate, days: 2),
                DepartureDate = Before(_bookingExisting.ArrivalDate)
            };

            // Act
            var result = BookingHelperWithDependencyInjection.OverlappingBookingsExist(bookingCurrent, _repository);

            // Assert
            result.ShouldBeEmpty();
        }
        public void BookingsOverlapButCurrentBookingIsCancelled_ReturnsEmptyString()
        {
            // Arrange
            var bookingCurrent = new Booking
            {
                Id            = 1,
                ArrivalDate   = After(_bookingExisting.ArrivalDate),
                DepartureDate = After(_bookingExisting.DepartureDate),
                Status        = "Cancelled"
            };

            // Act
            var result = BookingHelperWithDependencyInjection.OverlappingBookingsExist(bookingCurrent, _repository);

            // Assert
            result.ShouldBeEmpty();
        }
        public void BookingsOverlapButExistingBookingIsCancelled_ReturnsEmptyString()
        {
            // Arrange
            Mock.Get(_repository)
            .Setup(r => r.GetActiveBookings(1))
            .Returns(new List <Booking> {
            }.AsQueryable());

            var bookingCurrent = new Booking
            {
                Id            = 1,
                ArrivalDate   = After(_bookingExisting.ArrivalDate),
                DepartureDate = After(_bookingExisting.DepartureDate)
            };

            // Act
            var result = BookingHelperWithDependencyInjection.OverlappingBookingsExist(bookingCurrent, _repository);

            // Assert
            result.ShouldBeEmpty();
        }