To make sure each goods has been applied correct tax rate and give correct total cost
Fist, we should prepare basic test data: Goods Type
Goods_Type |
---|
Food |
Book |
Medical |
Other |
Then, we should prepare basic test data: Rate
Description | Rate |
---|---|
Basic Rate | 10% |
Imported Rate | 5% |
Then, we should generate basic test data and verify the data can be put into database is correctly
Goods Name | Basic Price | Type | Import |
---|---|---|---|
Clean Code | 12.49 | Book | No |
music CD | 14.99 | Other | No |
box of chocolates | 10.00 | Food | Yes |
Then, we should first verify rounding rules
Basic Tax Cost | Basic Tax Cost after applying rounding rule | Import Tax Cost | Basic Tax Cost after applying rounding rule | Total Tax |
---|---|---|---|---|
0.06 | 0.10 | 0 | 0 | 0.10 |
0.03 | 0.03 | 0 | 0 | 0 |
0.06 | 0.10 | 0.03 | 0.03 | 0.13 |
Verify the saved data to make sure the basic data is correct
Goods Name | Basic Price | Type | Import |
---|---|---|---|
Clean Code | 12.49 | Book | No |
music CD | 14.99 | Other | No |
box of chocolates | 10.00 | Food | Yes |
In this test, we need to verify the tax, the total cost should be correct
Goods_Name | Goods_Number | Tax | Total_Cost |
---|---|---|---|
Clean Code | 1 | 0.00 | 12.49 |
music CD | 1 | 1.50 | 16.49 |
chocolate bar | 1 | 0.50 | 10.05 |
Total | 3 | 2.0 | 39.03 |