/*=====
  testing script for function total_on_hand

  by: Sharon Tuttle
  last modified: 2016-01-29
=====*/

spool total_on_hand_test_out.txt
set serveroutput on

prompt
prompt *********************************
prompt TESTING total_on_hand
prompt *********************************
prompt

var result_total number;

prompt test passes if it shows, for Prentice Hall, total 
prompt quantity on hand of 22:
prompt ==========================================================

exec :result_total := total_on_hand('Prentice Hall')
print result_total

prompt
prompt test passes if it shows, for Addison-Wesley, total 
prompt quantity on hand of 30:
prompt ==========================================================

exec :result_total := total_on_hand('Addison-Wesley')
print result_total

prompt
prompt test passes if it shows, for Merrill, total
prompt quantity on hand of 0:
prompt ==========================================================

exec :result_total := total_on_hand('Merrill')
print result_total

prompt
prompt test passes if it shows, for nonexistent, total 
prompt quantity on hand of 0:
prompt ==========================================================

exec :result_total := total_on_hand('nonexistent')
print result_total

spool off

-- end of total_on_hand_test.sql