Unit Testing Support for .NET 6

You can now build and run COBOL unit tests within a .NET 6 command line environment.

If you have a command line environment that has the .NET 6 SDK installed, you can install templates that create new unit testing projects, test cases and data-driven test cases. These templates are supplied as a NuGet package, available from a sub-directory of your Micro Focus product's installation directory. After installation, you can use the dotnet command line utility to build and run unit testing projects.

New unit testing projects use a .cblproj project file that contains all the settings for building and running the project. You can use the dotnet command to override some of these defaults when the project is created; see Using the dotnet Command Line Utility to Manage Unit Testing Projects.

Unit tests (fixture files) should be stored in the same directory as the project file. By default, 'Test' is prefixed to the fixture file name, as the build process is designed to build any files with this prefix.

External dependencies are also handled by the .NET 6 support. If your test cases call into external programs, add a reference to the project of the external code, and then when the local project is built, the default behavior is to perform a dotnet restore to ensure that the latest versions of the dependencies are restored and used when building the test case(s).

The writing of tests, including the syntax you need to use to call into any external code, is the same as it is when writing tests in any other environment. Some of the dotnet commands will code some of the necessary syntax for you; for example, creating an external reference will create the necessary procedure pointer declaration in your local test case.

Test cases can also be run through the dotnet command, or by using the .NET 6-specific test case runner mfurunil6 (Windows) or cobmfurunil6 (UNIX).