Click here to Skip to main content
15,885,855 members
Articles / Programming Languages / C#
Tip/Trick

Running NUnit GUI tests using FinalBuilder

Rate me:
Please Sign up or sign in to vote.
1.00/5 (11 votes)
25 Aug 2005CPOL2 min read 34K   12  
A self created final builder tutorial

Initial requirements:<o:p>

  • Reader is familiar with the usage Nunit and knows how to create Nunit tests or projects.
  • Reader is familiar with the menus and links provided on the FinalBuilder tool.
  • Reader is familiar with coding and creating projects and DLLs using C#.

Steps:

Create a Nunit project

  1. First create a project using Nunit that would contain the DLLs to be tested. Alternatively you could point to an existing C# project.
  2. To do this you may run the Nunit-Gui.exe which in turn opens Nunit-Gui application.
  3. In this example you may open the DLL mock-assembly.dll that is automatically installed at the time of installing Nunit. Normally this is stored in the path “C:\Program Files\NUnit 2.2\bin”
  4. Save the file as a Nunit test project (*.nunit) file type. Name it “mock-assembly.nunit” (“.nunit” is the file extension).

Image 1

Running the test from FinalBuilder

  1. Create a new FinalBuilder project and name it as “FinalBuilderLesson.fbz3”.
  2. In the top of the FinalBuilder editor right click next to right of the action list “OnFailure” to open the pop up menu.
  3. In the pop up menu select “Add Action List”. Give the name of the action list as “Nunit Test”.
  4. From the left menu  click on “Windows OS” to view the action items available in it (if not already visible).
  5. Double click on the “Execute Program” icon. This opens up the “Execute Program” action item properties box.
  6. Select the page “Program”.
  7. In the program file input box browse to the path where you saved the “mock-assembly.nunit” file.
  8. In the Options – Parameters input box type in “mock-assembly.nunit /run”
  9. In the Options – Start in input box type in “<the directory where the file is stored>”
  10. Uncheck the Options - Hide Window check box.
  11. Save the project.
  12. Now select the Execute Program action type and click Alt + F9

Image 2

<o:p>End notes

To make this application is little bit robust I added the try, catch, finally and end action tags from the flow control in the left menu. To move the “Execute Program” action list inside the catch block use the menu items in the “Actions” top menu. In the try block I have put a “Windows Does Exist” action item. This item is the “Windows Exist” menu item in the “Windows OS” of the left menu list.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
India India
achievements: underpaid-underrated-confused
status: Comfortably_Numb

Comments and Discussions

 
-- There are no messages in this forum --