End the test
- Last Updated: June 1, 2021
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
When you finish testing or if you want to test a different constructor, you should first delete the instance using the following syntax:
delete object <instance name>.
Here is all the code for our example test procedure for the Emp class. Notice at the bottom of the file that we delete EmpInstance and close the output file.
block-level on error undo, throw.
using Enterprise.HR.Emp.
// define the array for holding the phone numbers
var char[3] Phones = ["617-284-5937","508-394-3928","508-294-3927"].
// set up the file for writing data
output to "/testResults/log/test-Dept.out".
// create and initialize an Emp instance
var Emp EmpInstance = new Emp().
EmpInstance:Initialize(99,
"John",
"Doe",
"123 Main Street",
"01730",
Phones,
50,
"Senior Developer").
Message "*********testInitialize()************" skip
EmpInstance:FirstName " "
EmpInstance:LastName " , "
EmpInstance:JobTitle skip
"Emp # " EmpInstance:EmpNum "- Vacation hours: "
EmpInstance:VacationHours skip
EmpInstance:Address " "
EmpInstance:PostalCode skip
"Phones: " EmpInstance:Phones[1] " "
EmpInstance:Phones[2] "" EmpInstance:Phones[3] " ".
delete object EmpInstance.
output close.