One of the new features in NAV 2009 SP1 is C/AL Testability.
Let try using the new feature to test a simple codeunit – let us call the codeunit doTest. The codeunit will only contain a simple function, that includes a confirm and will look like this:
| cside | | copy code | | ? |
PROCEDURE TestConfirm@1112800000(useConfirm@1112800000 : Boolean) out : Boolean; |
BEGIN |
IF useConfirm THEN |
IF CONFIRM('Do you confirm?',TRUE) THEN
|
EXIT(TRUE) |
ELSE |
ERROR('No confirmation!');
|
EXIT(FALSE); |
END; |
Read the rest of this entry »
