Unofficial Content

GXUnit3 - How it Works

You create procedures that have the goal of testing a certain functionality - the granularity of the functionality to test is your call, but the intent is to test "units".

(To see how to write test see GXUnit3_WriteATest)

You organize your tests in suites - the suite will group related tests so that they are easier to manage. 

The programs that execute the tests are included in the KB when you start using GXUnit, but there is one of them (the test-loader) that will be regenerated every time you select tests to run.

Tests are selected in the GXUnit tool-window


When you hit Test the GXUnit_LoadTests gets regenerated with the selected tests - for example:

Loads the tests to be executed.
This program is overwitten every time GXTest executes

Created Automatically by GXUnit

//Output File

&GXUnitSuiteCollection = new()

&GXUnitSuite = new()
&GXUnitSuite.SuiteName = 'LoginTest'

&GXUnitTestCase = new()
&GXUnitTestCase.TestName = 'TestLoginValidate_InvalidBlankUser_ReturnExcep'


//Add Calls for Static-Link
if false

In the CCNet output if this test runs you would see something like this in the case of a successful run


and something like this in the case it fails



Note that if you want to keep running the same tests you don't need to run them from the GXUnit window - it is enough to execute the GXUnit_RunTests procedure. You can compile this program and run it from the command prompt as well (to run tests automatically without the need of the GeneXus IDE)

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant