vbUnit Add-In Interface
vbUnit will add the following entries to this menu:
- Show / Hide vbUnit Window
- Show or hide the vbUnit Add-In window.
- vbUnit Options
- Open the vbUnit Options Dialog.
- Run vbUnit TestSuite
- Run the currently selected TestSuite. This is the same as pressing the Run button in the vbUnit window. If you click on this menu entry while the vbUnit window is closed, it will be opened to display the test results.
- Close all windows
- Close all windows that are currently open in the VB IDE. This menu entry is provided because the code matching feature can open quite a lot of windows when it searches the whole project. If you don't need this menu entry, you can disable it in the vbUnit Options.
The vbUnit Add-In window is the central place for running tests and viewing their results. This window is dockable, so you can for example attach it to the lower half of the VB IDE window. If you double-click on the blue title bar of the Add-In window, you can switch back and forth between the docked and undocked state. VB will remember the size and position of the window in both states. This is useful for viewing the TestResults in a very large window in the undocked state, and then switching back to the smaller docked state to view the results and the code at the same time.
The vbUnit AddIn window has the following interface elements:
- Run the currently selected TestSuite and display the results in the results window.
- Select the TestSuite to be run. This menu shows all the TestSuites that
could be found in all the projects currently loaded in the IDE. To read
about how to set the default selection and how to add entries to this menu,
- Clear the results window.
- Options Button
- Open the Options Dialog
- Help Button
- Open the Help Viewer
This part of the vbUnit window lists the TestResults of the last run. You can customize the appearance of the results in the vbUnit Options dialog. You can also edit the result, for example to insert white space to enhance the readability of some complex string comparisons. Further, you can select any part of the result and then copy it to the clipboard.
If you double-click on a line in the results display, vbUnit will try to
highlight the corresponding line of code where the error or failure occured.
This is done by matching the type of result (error, assertion, or message) and
the assertion message. To find the exact code line, the assertion message must
be a literal string (e.g. "msg1"), not an expression (such as
"msg" & i),
and it must be unique within its search scope (method, file, or
project). You can adjust the settings for
this feature in the vbUnit Options.
To see some examples of how this feature works, you should add the fixture "TestHighlightCode" to the main suite of the "TestVBUnitFramework" project and play with the results.
Right-click into the results display to open the context menu. This
menu allows to select some or all parts of the result and to copy them to the
clipboard or to save everything to a file. You can also open the vbUnit Options
dialog from here.
If you save the results to a file, they will be save as plain text. If you want to preserve the color formatting, select "Copy All" and then paste the results into Word or Wordpad.