Example #1
0
 public TestRoomAvailabilityStore(params RoomAvailability[] availabilities)
 {
     store = new InMemoryRoomAvailabilityStore();
     foreach (var availability in availabilities)
     {
         store.Save(availability);
     }
 }
Example #2
0
 public void Save(RoomAvailability roomAvailability)
 {
     if (roomAvailability.RoomId == Ids.OptimisticLockRoom)
     {
         throw new OptimisticLockException(nameof(RoomAvailability), roomAvailability.Id, 2, 1);
     }
     store.Save(roomAvailability);
     Saved = roomAvailability;
 }