public PutInBookingRequest(LodgingId id) { if (id == null) throw new ArgumentNullException(nameof(id)); LoggingId = id; Id = Guid.NewGuid(); }
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>()); }
public LodgingAvailability(LodgingId lodgingId) { if (lodgingId == null) throw new ArgumentNullException(nameof(lodgingId)); Id = lodgingId; }
public void Should_not_throw_on_construction_for_valid_id(int id) { var lodgingId = new LodgingId(id); Assert.Equal(id, lodgingId.Id); }