Report for lv.id.jc.VendorBonusTest


Summary:

Created on Tue Oct 25 14:34:32 UTC 2022 by runner
Executed features Passed Failures Errors Skipped Success rate Time
2 2 0 0 0 100.0% 0.039 seconds
Bonus from vendor
a positive number representing a bonus from the vendor for the work performed

Features:

should create an instance of VendorBonus for a positive number Return
(0.001 seconds)
When:
we create a vendor bonus using a positive number
def bonus = VendorBonus.of(value as double)
Then:
the object created successfully, no exceptions was thrown
notThrown IllegalArgumentException
And:
this object can be used as a regular high precision number
bonus instanceof BigDecimal
Where:
various positive numbers
Examples:
value
1 OK (0.001 seconds)
0.001 OK (0)
4.9E-324 OK (0)
38 OK (0)
1.7976931348623157E308 OK (0)
5/5 passed
should throw an exception for a negative number Return
(0.002 seconds)
When:
we are trying to create a vendor bonus using a negative number
def bonus = VendorBonus.of(value as double)
Then:
we cannot create this object and an exception is thrown
def message = thrown IllegalArgumentException
And:
the error message indicates the reason for the exception
message =~ "must be a positive"
Examples:
value
-1000000 OK (0.002 seconds)
-1 OK (0)
-0.01 OK (0)
-4.9E-324 OK (0)
4/4 passed