Tips for testing attributes of object types
Suppose my code is this:
CREATE OR REPLACE PROCEDURE qctod#out_object (
firstname_in IN VARCHAR2
, lastname_in IN VARCHAR2
, name_object_out OUT qctod#name_type
l_object qctod#name_type := qctod#name_type (firstname_in, lastname_in);
name_object_out := l_object;
I will then go into Test Builder and take these steps:
We automatically create an outcome based on the object type, but it is of no use, since Code Tester cannot test object types directly. So remove this outcome. Then press the Outcome Wizard and choose Expression:
Then on the next page set up a test of a particular attribute of the type; the name of the variable holding the object instance will be of form p_<argument_name>.
I then create an equality test and type in the string I expect. Finish, and then do this for each attribute, and it should work….
And now I run the test and see: