Welcome to the NatUnit Wiki! Here you can find information about:
NatUnit is an easy to use unit testing framework for Software AG's Natural, as the following code (a simple test case) shows. The whole framework is written in Natural itself, so you don't have to use external tools like NaturalONE.
DEFINE DATA
PARAMETER USING NUTESTP
LOCAL USING NUCONST
LOCAL USING NUASSP
END-DEFINE
*
NUTESTP.FIXTURE := 'Example TestCase 1'
*
INCLUDE NUTCTEMP
INCLUDE NUTCSTUB
*
DEFINE SUBROUTINE TEST
*
********************************************************************************
IF NUTESTP.TEST EQ 'compare two equal numbers should pass'
********************************************************************************
ASSERT-LINE := *LINE; PERFORM ASSERT-NUM-EQUALS NUASSP 2 2
END-IF
*
END-SUBROUTINE
*
END
L4N offers basic logging functionality for Software AG's Natural, including:
Using the framework is easy, as the following code shows:
LOCAL USING L4NCONST /* some constants like log levels etc.
LOCAL USING L4NPARAM /* the parameters (e.g. log text) for calling the actual logging
...
* (optional) basic configuration of logging for the current module
L4N-DEBUGUSER := 'macke'
L4N-LOGTYPES := C-LOGTYPE-FILE + C-LOGTYPE-WRITE
L4N-LINENR := *LINE; L4N-DEBUGLEVEL := C-LOGLEVEL-DEBUG
INCLUDE L4NENTER
...
* the actual logging
COMPRESS 'Current value:' #VALUE INTO L4N-LOGTEXT
L4N-LINENR := *LINE; L4N-LOGLEVEL := C-LOGLEVEL-INFO
INCLUDE L4NLOGIT
[Install]
[How_to_use_NatUnit]
[How_to_use_L4N]
Markus Wessjohann (mwessjoh) mwessjoh@users.sf.net
Wiki: How_to_use_L4N
Wiki: How_to_use_NatUnit
Wiki: Initiators of NatUnit
Wiki: Install
Wiki: Softwaretools for Natural