Jan 01 2007

Getting Fit With .Net: Quick Introduction to Testing .Net Applications with FitNesse

Published by gojko

FitNesse resources

Test Driven .NET Development With FitNesse: A detailed guide on using FitNesse and TDD practices to build better .NET software

Getting Fit With .Net: Quick Introduction to Testing .Net Applications with FitNesse

DbFit: Test-driven database development

Fixture Gallery: Straight-forward examples for the most common fixture types in .NET and Java

FitNesse.Info: Links to other FitNesse related resources.

FitNesse-related articles on this web site

.

A short tourist guide to get you on your way to the wonderful world of FitNesse, covering:

  • Setting up a FitNesse server for testing .Net code
  • Writing basic tests, performing common tasks
  • Saving time and effort with specialised test types
  • Tips and tricks for writing better tests and making test pages easier to read
  • Managing content with FitNesse
  • Organising tests into test suites
  • Most important differences between .Net and Java versions

Current version of the guide is 0.2 (16. February 2007). Download the guide as a PDF (1.5 MB), source code for the examples in the guide and Wiki pages with binary version of examples.

See links to other Fitnesse resources, mentioned in the guide. You might also be interested in DbFIT: Test driven database development with FitNesse.

Getting Fit With .Net is a free document, and you can freely redistribute it as a PDF, unmodified and in original form – all other rights are reserved by the author.


16. February 2006. Update: new version of the guide (0.2) covers Fit.Net 1.1, and has a new chapter on DoFixture, working with arrays and business objects and writing better test scripts.


22 Responses to “Getting Fit With .Net: Quick Introduction to Testing .Net Applications with FitNesse”

  1. shenzhion 21 Jan 2007 at 4:40 pm

    Very good and the best for Fitnesse/NET.

    There are somethings I want to know:
    1: NET uses .config file to setup and how about FitNesse?
    2: How to setup if I put the code tested and the fittures at diff locations?

  2. gojkoon 21 Jan 2007 at 4:57 pm

    1: fitnesse is configured by parameters and properties of wiki pages - that’s explained in the guide. if you have a particular problem that is not explained in the guide - let me know and i’ll try to help
    2: just add two !path lines - one for your code and the other for the fixtures.

  3. Mortenon 22 Apr 2007 at 8:53 am

    Thanks for making this document. It has helped me tremendously in setting up FitNesse for .net and getting started with using it.

    I have one question. I am considering going through the effort of setting up Orcas Beta 1 to see what can be done with the new out of the box continuous integration stuff. Orcas uses .Net version 3.5, and I wonder if you know whether or not the FitNesse for .Net 2.0 will work here? I mean, generics and nullable types would probably be the biggest issue, and that is already fixed in 2.0.

    Any input is appreciated.

    Morten

  4. gojkoon 22 Apr 2007 at 12:10 pm

    Hi Morten,

    thanks for your support. I have not used fitnesse with .net 3.5,
    but I’m using it in a .2+.3 environment without problems. limited support for generics and nullable types is already in main fit.net branch, and is getting better with every release. there is also a small patch I published enabling nullable types to be used better with fitnesse (see http://gojko.net/fitnesse/fdnpatch). If you decide to
    do orcas tests, please let me know how it comes out, I’d love to hear your experiences.

  5. Joeon 26 Apr 2007 at 6:02 pm

    Fantastic. This is an exceptional document that got me up and running! Thank you!

  6. Michael Hedgpethon 05 Jun 2007 at 9:29 pm

    I gave up on doing fitnesse .NET (even after buying the book) until I found your document. Well done!

  7. Leo Paul Clementon 08 Jun 2007 at 7:25 pm

    Hi All
    I am new to FitNesse and am trying with dotnet. I am now trying to
    execute the TestRunner For WebService dll and the connection string is
    provided in the web.config File. I were able to run the test with the
    Fitnesse User Interface i.e., through localhost:8080/MyTestPage.Tests,
    simply adding the config file path to the PATH directive. When I do
    the same with TestRunner in dotnet it throws error and no tests are
    run. Can anyone provide a solution. Thanks in advance.

  8. gojkoon 09 Jun 2007 at 12:45 pm

    the path directive is used only for fixtures, not for config or additional files. try to put your config file in the same folder as testrunner.exe, that should do the trick.

  9. Marisaon 19 Dec 2007 at 7:46 am

    Hi Gojko,

    I ran into a problem with passing a value into a RowFixture using a symbol:

    !|MyRowFixtureClassName|<<thingID|
    |ThingID|ThingDescription?|

    I saw your explanation in the PDF about the problem with symbols - but I do have the fit.dll with your updates for .NET and am still getting the error “Input string was not in a correct format.”

    I added Fixture.Recall{”thingID”) to the fixture code so I can move forward but I just wanted to check with you to see if you think I *should* be able to pass a value to a RowFixture as an argument via a symbol?

    Thanks for your help.

    BTW - I’m not using DBFit for this particular set of tests because I need to exercise module code in the tests. :-)

  10. gojkoon 19 Dec 2007 at 8:11 am

    Hi Marisa,

    with the fitnesse.net patch, you should be able to pass the symbol value directly as an argument, but you will not be able to read it out from Args array - you’ll need to use ArgsObjects array instead.

  11. Marisaon 19 Dec 2007 at 8:30 am

    Thanks Gojko - sorry to bug you again but I’m trying to find ArgsObjects but can’t (our fixture class inherits from fit.RowFixture). Where can I find it?

    I’ve got version 1.2.2722.26847 of fit.dll

  12. gojkoon 19 Dec 2007 at 8:37 am

    Hi Marisa,

    If you are using FIT.NET DLLs from http://gojko.net/fitnesse/fdnpatch/, then it should be a protected static field in the Fixture class.

  13. Marisaon 19 Dec 2007 at 2:55 pm

    Hi Gojko,

    OK - I got the patch DLLs but now my existing tests are all throwing this exception:

    System.MissingMethodException: Method not found: ‘fit.ICellHandler fit.CellOperation.GetHandler(fit.Fixture, fit.Parse, fit.Accessor)’.
    at dbfit.AbstractDataTableFixture.IsMatch(Parse row, DataRow d)
    at dbfit.AbstractDataTableFixture.FindMatchingTableRow(Parse row, DataTable table) in D:\work\dbfit\impl\dotnet\src\fixture\AbstractDataTableFixture.cs:line 68
    at dbfit.AbstractDataTableFixture.DoRows(Parse rows) in D:\work\dbfit\impl\dotnet\src\fixture\AbstractDataTableFixture.cs:line 45
    at fit.Fixture.DoTable(Parse table)
    at fitlibrary.FlowFixtureBase.ProcessRestOfTable(Fixture theFixture, Parse theRestOfTheRows)

    I thought I might be able to get around this by having two sets of DLLs to reference in different suites (one to reference the set that works with DBFit; the other to reference the set that contains the patches) - but I also need to use DBFit commands in the RowFixture test pages so I didn’t know if that would work. What do you suggest?

  14. Marisaon 19 Dec 2007 at 8:11 pm

    Hi Gojko,

    Never mind that last post - we’re going to move forward with using the Recall method.

    Thank you!

    Marisa

  15. gojkoon 22 Dec 2007 at 1:27 am

    Hi Marisa,

    the issue is with FitNesse.NET 1.3 compatibility. the patch was never upgraded to 1.3 because nobody requested that before. DbFit was upgraded to work with 1.3. I can try and merge the patch with 1.3 if you are still fighting with this issue.

  16. xgallerion 27 Dec 2007 at 3:28 pm

    Hi Gojko,

    You doc is wonderful! And extremely useful! Thanks to it, I successfully set up the samples, up to the DoFixture ones.

    Now, I tried to setup some test suites and I bump into some troubles when mixing up suites and DoFixtures. Indeed, the ‘import’ statement that you recommend to put in the suite’s SetUp page fails with regards to DoFixture tests.

    Is that something you encountered already?

    Thanks again!

    - Xavier

  17. gojkoon 27 Dec 2007 at 3:43 pm

    Hi Xavier,

    to use a DoFixture in flow mode, it must be the first table on the page. Not even import can come before it. But you can use import after you start the DoFixture to include namespaces for other fixtures, that will be used on the same page.

  18. xgallerion 27 Dec 2007 at 5:01 pm

    Hi Gojko,

    Thank you for your answer.

    Now, I’m thinking about using a DoFixture as a mean to settle some testing behaviour that would be shared among different test suites (or test cases). Thus, I would like to execute this DoFixture table before other tests begin (like in a SetUp execution).

    Do you know how I can do that? Or do you have any other idea?

    Thx,
    -Xavier

  19. gojkoon 27 Dec 2007 at 5:40 pm

    Hi Xavier,

    SetUp and TearDown are considered by the test runner as an integral part of the page, so you can start your dofixture in setup and continue using it in the page and TearDown

  20. xgallerion 28 Dec 2007 at 9:33 am

    Ok! That sounds good! Thank you!

    Now, I bump into the “configuration” file issue but for a DLL (let say, “my-project.dll”). I tried to create :
    - a “my-project.dll.config” file in the folder where the DLL is => failed
    - a “TestRunner.exe.config” file in the folder where TestRunner is => failed
    - a “my-project.dll.config” file in the folder where TestRunner is => failed

    I also tried to put a copy of my DLL in the same folder as TestRunner, but it failed too :-(

    Any ideas?

    Rgds,
    -Xavier

  21. gojkoon 28 Dec 2007 at 10:07 am

    Hi Havier,

    FitNesse uses FItServer.exe, not testrunner.exe

  22. xgallerion 28 Dec 2007 at 10:35 am

    Yes. That’s what I found eventually ;-)

    Thx

Trackback URI | Comments RSS

Leave a Reply