private void Compose() { var hotel = new Hotel.Hotel(_numberOfRoom); var findRoom = new FindRoom(); var reservation = new RoomReservation(hotel, findRoom); var validation = new ReservationValidation(); _reservation = new RoomReservationDecorator(reservation, validation); }
public void ThrowExceptionIfAgainstBookingPolicy() { var hotel = new Hotel.Hotel(hotelId, "Hotel Marigold"); hotel.SetRoom(101, Master); mockHotelService.Setup(it => it.FindHotelBy(hotelId)).Returns(hotel); mockBookingPolicyService.Setup(it => it.isBookingAllowed(employeeId, Master)).Returns(false); Assert.Throws <InsufficientPrivilege>(() => bookingService.Book(employeeId, hotelId, RoomType.Master, checkIn, checkOut)); }
public BookingServiceShould() { bookingService = new BookingService(mockHotelService.Object, bookingRepository.Object, mockBookingPolicyService.Object, idGenerator.Object); var hotel = new Hotel.Hotel(hotelId, "Hotel Marigold"); hotel.SetRoom(101, Standard); mockHotelService.Setup(it => it.FindHotelBy(hotelId)).Returns(hotel); mockBookingPolicyService.Setup(it => it.isBookingAllowed(employeeId, Standard)).Returns(true); }
public void StoreAndRetrieveHotels() { var hotelId = Guid.NewGuid(); var hotelName = "Hotel Transylvania"; HotelRepository.AddHotel(hotelId, hotelName); var hotel = new Hotel.Hotel(hotelId, hotelName); Assert.Equal(hotel, HotelRepository.FindHotelBy(hotelId)); }
public void SetStandardRoom() { var hotelId = Guid.NewGuid(); var hotelName = "The Grand Budapest Hotel"; var hotel = new Hotel.Hotel(hotelId, hotelName); HotelRepository.Setup(it => it.FindHotelBy(hotelId)).Returns(hotel); HotelService.SetRoom(hotelId, 101, RoomType.Standard); Assert.Equal(hotel, HotelService.FindHotelBy(hotelId)); }
public HotelShould() { hotel = new Hotel.Hotel(Guid.NewGuid(), "Hotel California"); hotel.SetRoom(101, Standard); }