Creating a Unit Test Project

Test fixture files (and the test cases within them) can only be created in a unit test project.

  1. While in the COBOL perspective, select File > New > COBOL Unit Test Project.

    The New COBOL Unit Test Project dialog box appears.

  2. In the Project name field, type TestAirportDemo.
  3. Click Finish.

    The project is created, and displayed in COBOL Explorer.

    Before you add a test fixture file to the project and run it (during which, a COBOL Unit Test run configuration is created), you'll add the environment variable that enables the test run to locate the data file used by the unit tests. (If you do not create the variable before the run configuration is created, you must manually configure it from the Environment tab within the run configuration details once the run configuration has been created.)

  4. Select Project > Properties.

    The Properties for TestAirportDemo dialog box appears.

  5. Click Micro Focus > Run-time Configuration > Environment Variables.
  6. On the Environment Variables page, click Add, then add the following values and click OK:
    • Variable: dd_airports
    • Value: ..\..\AirportDemo\airports.dat
  7. Click OK.
  8. Click Apply and Close.

    Test cases within this unit test project will now use the original data file used by the AirportDemo application.

Next you must add the test fixture file that will contain your test cases.