Unit Testing in the IDE

The Micro Focus Unit Testing Framework is an xUnit-style testing framework, available from the Enterprise Developer command line prompt, or from the IDE. It supports native COBOL applications, and .NET COBOL applications.

Within the IDE, group your tests inside a unit test library (a project of type 'unit test library'), which should be located in the same solution as the application under test; alternatively, you can have a standalone test library, where all source under test and the test cases themselves are contained in one project.

Integrating your test cases into the same solution as the application that you plan to test enables you to directly call into the source code of the application. For stand-alone unit test libraries, you need to import a copy of the source code into the library in order to test it.

Each test case is capable of performing a setup, running the test case, and then performing a test teardown. You can also apply certain test metadata to the tests, which in certain cases affects how the test case runs. Running test cases in conjunction with Code Coverage adds an extra dimension to your code analysis: a breakdown of the code covered when your tests run helps you to troubleshoot failing tests.

The Micro Focus Unit Testing window is the control panel where you run, debug and rerun your test cases. It also shows an overview of the number of successful and failed test cases that you have.