Example: Testing a Visual COBOL Application

This topic describes how you can test a Visual COBOL application with Silk4NET. For this example we test the WPF Book, which is a .NET COBOL sample application.

When you install Visual COBOL, you also install the Visual COBOL sample applications. You can use the Samples Browser to open the sample applications in Visual Studio. For additional information on the Samples Browser, refer to the Visual COBOL documentation.

Note: The following example was performed with Visual Studio 2015 and Micro Focus Visual COBOL for Visual Studio 2015. In other versions of these projects, the user interfaces might look slightly different.
  1. To open the WPF Book in Visual Studio, open the Samples Browser, select Windows Presentation Foundation, and select WPF Book from the list. Then click Open sample in Visual Studio.
  2. In Visual Studio, open the Solution Explorer to access the WPF Book solution.
  3. Right-click on the WPFBook project in the solution an click Build to build the project.
  4. Open the Samples Browser again to access the newly built executable.
  5. Select the WPF Book and click Open sample folder.
  6. Navigate to WPFBook\Bin\Debug.
  7. Double-click WPFBook.exe.
  8. Create a new Silk4NET project in Visual Studio.

  9. Start recording a new Silk4NET test.

  10. In the Select Application dialog box, select the Windows tab.
  11. Click WPFForm Book Demo.

  12. Click OK.
  13. In the WPFForm Book Demo, click Show List of Books.
  14. Move the mouse cursor over the RetailPrice column of Oliver Twist and click Ctrl+Alt to verify that the retail price is 10.00.

  15. Click OK in the Verify Properties dialog box.
  16. Click Close in the WPFListView window.

  17. Click Stop in the Recorder window.
  18. In Visual Studio, right-click on the recorded test method and select Run Tests.

    The test should pass, and you can now explore the test results.