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