To test the AddressBook Class, we will create a simple Test Activity that puts an entry into an AddressBook and then gets it back again.
To create a Test Activity
- Right click on the root Model in the Model Browser, select Create Element, and then select Activity.
 - Enter Test as the name of the Activity.
 - Click on Test, and open the Alf editor window (select Windows > Alf), if it isn't already open.
 Type the Alf code shown in the figure below.

- When the text is correct, click Save.
 
To run the Test
- Right click on Test in the Model Browser, and select Simulation > Run.

 Click on the Start button. The output should appear in the Console pane, as shown in the figure below.

Related pages