예제 #1
0
        public PutInBookingRequest(LodgingId id)
        {
            if (id == null)
                throw new ArgumentNullException(nameof(id));

            LoggingId = id;
            Id = Guid.NewGuid();
        }
예제 #2
0
        public void ConfirmBookingOnAvailableLodging(LodgingAvailability lodgingAvailability, PutInBookingRequest command, IEvent @event)
        {
            var lodgingId = new LodgingId(343);

            "Given LodgingAvailability ID 343 from 1 to 7 June."
                .x(() => lodgingAvailability = new LodgingAvailability(lodgingId));

            "And booking request for Lodging ID 343"
                .x(() => command = new PutInBookingRequest(lodgingId));

            "When a Guest is making a booking request for Lodging ID 343"
                .x(() =>
                {
                    lodgingAvailability.BookLodging(command);
                    @event = lodgingAvailability.GetChanges().First();
                });

            "Then Lodging booking is confirmed"
                .x(() => @event.Should().BeOfType<LodgingBooked>());
        }
예제 #3
0
        public LodgingAvailability(LodgingId lodgingId)
        {
            if (lodgingId == null) throw new ArgumentNullException(nameof(lodgingId));

            Id = lodgingId;
        }
예제 #4
0
 public void Should_not_throw_on_construction_for_valid_id(int id)
 {
     var lodgingId = new LodgingId(id);
     Assert.Equal(id, lodgingId.Id);
 }