How do I setup FitNesse for use with .NET?

Fredrik picture Fredrik · Dec 1, 2009 · Viewed 10.4k times · Source

I'm trying to get started with FitNesse for .NET on Windows Vista. In all tutorials I find on the web I'm told to execute the run.bat file, but all i get when downloading the latest release is a .jar-file. When i run this, the filestructure is unpacked and I can reach the fitnesse server by browsing to http://localhost. Now, when I'm trying to set up a test project, according to all documentation I find I'm supposed define the path to fitsharp.dll but I can't find this file anywhere in the filestructure that was set up from the .jar-file. What am I doing wrong?

Answer

Konstantin Spirin picture Konstantin Spirin · Feb 9, 2011

Download FitNesse jar from http://fitnesse.org/.

Run

java -jar fitnesse.jar

It will start web server and create folder FitNesseRoot with wiki contents. To check that it has started navigate to http://localhost - you should see FitNesse front page.

Edit front page - just add something like HelloWorldTest (must be camel case!) in the bottom and save. Click on the appeared question mark and save a new page. Click Properties and make sure Page type is Test.

Download FitSharp from https://github.com/jediwhale/fitsharp and extract it to folder fitsharp next to your FitNesseRoot.

Create .Net project for tests, add references to fit.dll and fitSharp.dll located in just created fitsharp folder.

Write a simple test in .Net and compile it. For example use a simple column fixture as described on http://fitnesse.org/FitNesse.UserGuide.FixtureGallery.BasicFitFixtures.ColumnFixture. Add test table to our HelloWorldTest page.

On top of your FitNesse test page (in our example HelloWorldTest) enter:

!define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,fitsharp\fit.dll %p}
!define TEST_RUNNER {fitsharp\Runner.exe}
!path <path to your test assembly>

If you click on Test button and see no results then try to use TEST_RUNNER RunnerW.exe for troubleshooting.

Here's a great book on using FitNesse with .Net: http://fitnesse.s3.amazonaws.com/tdd_net_with_fitnesse.pdf