| Summary: | Incorrect result of Database test case as duplicate record exists | ||
|---|---|---|---|
| Product: | online shop management system | Reporter: | gkpcheung3-c |
| Component: | Database | Assignee: | gkpcheung3-c |
| Status: | RESOLVED FIXED | ||
| Severity: | major | ||
| Priority: | High | ||
| Version: | 1.0.0 | ||
| Hardware: | PC | ||
| OS: | Windows | ||
|
Description
gkpcheung3-c
2020-11-06 00:08:33 HKT
Using one of the test cases "test_getTotalIncome" as an example of the step: 1. Define Product p1, p2, p3. 2. Add p1, p2, p3 into the product database. 3. Calculate the expected total income of the product. 4. Calculate the actual total income of the product using the product database. 5. Compare the expected total income (from step 3) with the actual total income (from step 4). The bugs fixed successfully after setting the setup() method of the class testDB with clearing the database. As each test case in testDB will run setup() when running the test cases, if the database does not clear at the beginning, the record will keep increasing and duplicated. As a result, the result of the test case will be affected. |