Creating a Test Fixture

You now need to add a test fixture file to the unit test project.

  1. In COBOL Explorer view, ensure that the TestAirportDemo project is selected, then click File > New > Other.

    This opens the Select a wizard dialog box.

  2. Expand Micro Focus COBOL, and then click COBOL Unit Test.
  3. Click Next.

    This opens the New COBOL Unit Test dialog box.

  4. Select Self Contained Unit Test and click Next.
  5. In the Containing project field, ensure that it states the TestAirportDemo project; click Browse and select the project if this field is currently empty.
  6. In the Program under test field, click Browse, select the aircode.cbl program (from within the AirportDemo project), then click OK.
    Note: If the bitism of the unit test project does not match that of the project containing the program under test, the bitism of the unit test project is updated at this point.
  7. Click Finish.

    The MFUPD_aircode.cpy test fixture file is created within the TestAirportDemo unit test project. An additional copybook that serves as the Working Storage section of the test suite is required in order to utilize the mfunit.cpy copybook, which contains some essential declarations for the test runner.

  8. Click File > New > COBOL Copybook.

    The New COBOL Copybook dialog box is displayed.

  9. Ensure that the Containing project field states TestAirportDemo, and in the New file name field, type MFUWS_aircode.cpy, and then click Finish.
    Important: The naming of this file is specific: the program name under test must be prefixed with MFUWS_.

    The copybook is immediately opened in the editor.

  10. Within the copybook, type copy "mfunit.cpy". and then save the file.