Index: openacs-4/packages/acs-core-docs/www/files/tutorial/myfirstpackage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/tutorial/myfirstpackage-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/files/tutorial/myfirstpackage-procs.tcl 2 Feb 2004 18:08:29 -0000 1.1.2.1 @@ -0,0 +1,24 @@ +ad_library { + Test cases for my first package. +} + +aa_register_case mfp_basic_test { + Test One +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set name [ad_generate_random_string] + set new_id [mfp::note::add -title $name] + aa_true "Note add succeeded" [exists_and_not_null new_id] + + mfp::note::get -item_id $new_id -array note_array + aa_true "Note contains correct title" [string equal $note_array(title) $name] + + mfp::note::delete -item_id $new_id + + set get_again [catch {mfp::note::get -item_id $new_id -array note_array}] + aa_false "After deleting a note, retrieving it fails" [expr $get_again == 0] + } +} +