NEWPractise supported commands in browser simulations, alongside the lesson.Try a browser practice exercise.Try a lab♥ Codelivly is 100% free, no paywall. If it helped you, chip in to keep it running.100% free. Help keep it so.Support us
Preview · 35 min
How to test the type, range, sign and rounding rules of money fields with one case and one control, and how to record a negative quantity that the server accepts.
At 10:05:40 on Wednesday 2027-07-14, Ben saved a draft invoice with two lines. The first was 2 units at 3000 pence. The second was labelled as an adjustment, with a quantity of -1 at 2000 pence. The server answered 201, gave the draft the id inv_5509, and stored a total of 4000. Every digit of that arithmetic is correct. The second line should never have been accepted.
Money rules are mostly small statements about numbers: which type a value has, how low and how high it may go, whether it may be negative, and what happens to a fraction of a penny. Priya Raman wrote the Ledgerline versions down as BR5 in the rule document shared under change request CR-4. Each statement is cheap to test with one request and one control, and easy to test badly if you start guessing values.
Create a free account to unlock the rest of this task, complete tasks, and earn Rep.
Sign in