improve test for quantity-range violations, use maxQuantity