private void ValidateBookingIsAgency(Booking booking)
 {
     if (_BookingFeaturesDomainServices.IsAgency(booking))
     {
         throw new InvalidBookingOperationException("This booking was created by some Agency.");
     }
 }
Exemple #2
0
        public void Then_IsAgencyPassWithAgencyAgent()
        {
            mockFactory.ClearExpectations();

            bool expected = true;

            string salesAgent      = "Agency";
            int    amountOfBooking = 1;

            var booking = BookingProvider.GetBookings(salesAgent, amountOfBooking).First();

            _XXXLibraryConfigurationMock.Expects.One.GetProperty <string>(x => x.PartialCodeForAgencyAgent).WillReturn("agency");

            bool actual = Sut.IsAgency(booking);

            Assert.IsTrue(actual == expected, "Expected to pass IsAgency feature.");

            mockFactory.VerifyAllExpectationsHaveBeenMet();
        }
Exemple #3
0
        public bool IsAgency(BookingDTO bookingDto)
        {
            var booking = _localMapper.Map <BookingDTO, Booking>(bookingDto);

            return(_bookingValidationDomainServices.IsAgency(booking));
        }