Testing the event handler
For Sample Scenario 6: Requesting Multiple and Complex Approvals, you must perform these tests:
- Test 1: Create a purchase order for less than $100,000 and let the purchasing manager disapprove the order. See steps below.
Expected result: The PO status is not changed to Ordered.
- Test 2: This test is the same as Test 1, except that this time let the purchasing manager approve the change.
Expected result: The PO status is changed to Ordered and the PO is again enabled for change.
- Test 3: Create a PO with a total cost of between $100,000 and $1,000,000. Let the purchasing supervisor disapprove the order.
Expected result: The change is rolled back.
- Test 4: This test is the same as Test 3, except that this time let both the purchasing manager and purchasing supervisor approve the order.
Expected result: The change is written to the database and the record is again enabled for other changes..
To perform Test 1:
For complete thoroughness, other tests are devised and conducted before making this event handler live on an active system. For example, you can change the status to something other than Ordered and make sure that the PO change does not suspend. You can also test for the senior executive approvals and disapprovals.