Running fitness.Net tests in unit test – some tips
I posted a while ago on wiring in Fitness.Net into a unit test framework using HTML files to hold the tests. Well I have been using the technique for some workflow acceptance testing and hit a couple of gotta’s that are easy to forget:
- Make sure the HTML files containing the user story tests are set to copy to the project output directory in the IDE – if they are not then the framework cannot find the tests, so obviously none are run. The danger is you think the problem is an incorrect class or method name, when it is a simple missing file problem.
- If you edit the user story HTML file make sure you rebuild the solution. If you don’t do this the copy to the output directory might not be triggered as a simple build maybe skipped as the IDE will not see any changes to source files it needs to compile the project. This is especially easy to forget if you are using a test add-in such as Testdriven.net as opposed to clicking on build yourself.
- Be careful with the HTML editor you use to create user story file in case it reformats the page. This is important for parameters (but it seems not for the method name fields). You need to make they are formatted
as opposed to
as the latter will include the carriage returns characters in the parameters passed into the test so will probably fail.
I think that is all for now, I will post any others I find as they crop up
Read the complete post at http://blogs.blackmarble.co.uk/blogs/rfennell/archive/2008/10/04/running-fitness-net-tests-in-unit-test-some-tips.aspx