Testing server behaviors The Exchange recommends you perform the following tests on each server behavior you create:
Apply the behavior from the Server Behaviors panel. If it has a dialog box,
enter valid data in each field and click OK. Verify that no error occurs when
the behavior is applied. Verify that the runtime code for the server behavior
appears in the Code inspector.
Apply the server behavior again and enter invalid data in each field of the
dialog box. Try leaving the field blank, using large or negative numbers, using
invalid characters (such as /, ?, :, *, and so on), and using letters in numeric
fields. You can write form validation routines to handle invalid data (validation
routines involve hand-coding, which is beyond the scope of this book).
After successfully applying your server behavior to the page, verify the following:
Check the Server Behaviors panel to make sure the name of the server behavior
appears in the list of behaviors added to the page.
If applicable, verify that server-side script icons show up on the page. The
generic server-side script icons are gold shields. To see the icons, turn on
Invisible Elements (View > Visual Aids > Invisible Elements).
In Code View, (View > Code) verify that no invalid code is generated.
In addition, if your server behavior inserts code in the document establishing
a connection to a database, create a test database to test the code inserted
in the document. Verify the connection by defining queries that produce different
sets of data, and different sizes of data sets.
Finally, upload the page to the server and open it in a browser. View the page’s HTML source code and verify that no invalid HTML has been generated by the server-side scripts.
1 2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 422