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:

  1. On the Purchase Orders form, create a new PO and save the PO.
  2. On the Purchase Order Lines form, create a line for an amount of less than $100,000.
  3. On the Purchase Orders form, change the status for the line that you created to Ordered and save the PO.
    Notice that the PO record is disabled because the record is now in a suspended state. The status appears to revert to Planned, because the record is not yet approved. Thus, the record has not yet actually been changed in the database.
  4. Log in using the purchasing manager’s user ID.
  5. Open the Inbox form.
  6. Read the new prompt message that the system generated.
  7. On the Response tab, select the No option.
  8. Open or refresh the Purchase Orders form.
  9. Verify that the new PO line status is Planned and that the PO is again enabled for changes.
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.