public void RemoveRentItem(int position) { if (ValidTo.HasExpired()) { throw new RentHasExpiredException(); } var rentItem = _rentItems.Single(item => item.ItemPosition == position); _rentItems.Remove(rentItem); }
public void AddRentItem(RentItem item) { if (ValidTo.HasExpired()) { throw new RentHasExpiredException(); } if (_rentItems.Any(i => i.ItemPosition == item.ItemPosition)) { throw new RentItemAlreadyExistsOnPosition(); } }
public bool HasExpired() => ValidTo.HasExpired();