In this exercise, you will test the lab solution using specific scenarios that will test different cases that the CAccount component should handle. Throughout this exercise you should use the Data View window or some other query tool to check the value of a student's AccountBalance as you test the Authorize and Debit methods of the CAccount class.


Note  This exercise depends on the data in the StateUBookstore being the same data as delivered in the StateUBookstore database scripts that were provided on your CD.

Test for a student not authorized to buy a book

  1. Run the StateUBookstore application.

  2. Enter the Student ID 23.

  3. Attempt to buy any of the books for this student's classes.

    You should receive a message that this purchase would put the student over the credit limit.

Test for a student who can buy this book with a warning

  1. Run the StateUBookstore application.

  2. Enter the Student ID 39.

  3. Attempt to buy any of the books for this student's classes.

    You should receive a message that this purchase would put the student within $50 of the $500 limit.

    You should receive a second message notifying you that the charge has been incurred.

Test for a student who can buy this book with no warning

  1. Run the StateUBookstore application.

  2. Enter the Student ID 15.

  3. Attempt to buy any of the books for this student's classes.

You should receive a second message notifying the charge that has been incurred.