RE: [fitnesse] Unit testing fixtures...?
- Hi James,I tend not to unit test my Fixtures, but that's because I find the tests awkward to write, and I get pretty quick feed back from Fitnesse itself. Fitnesse itself does a pretty spotty job testing things like ColumnFixture and RowSetFixture, so I guess I'm in good company. Part of the problem with writing tests is that I end up having to parse the return html using the Parse object which is unpleasant.I do write tests for type converters because parsing code to be buggy -- at least for me.When I need some sort of logic in a Fixture I try to put it into a separate object, and then test the object. As an example I have tests that deal with large XML messages. I have a test helper object which knows how to parse and rip apart the XML into lists of similar objects -- extract all employee data from the message. I have unit tests that exercise the helper object. The actual Fixture is just an ArrayFixture wrapped around the employee list.Excuses aside, there have been times when having better unit tests would have been nice. For instance I recently upgraded the version of DoFixture I use. There were some subtle issues that took a while to discover while running the Fitnesse tests. Unit tests would have helped. I expect similar issues when I upgrade to the latest/greatest Fitnesse.Hope this helps,Christopher
From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of James Carr
Sent: Monday, July 31, 2006 2:08 PM
Subject: [fitnesse] Unit testing fixtures...?
I'm kind of curious if many people write unit tests for thier
fixtures. Usually I've pretty much just code the fixture until I don't
see any yellow from exceptions, nut lately I've pretty much adopted
the approach of unit testing only if the fixture performs some logic,
yet don't unit test the fixture if it just forwards data to the system
under test (kind of like dumb data objects).
What's everyone else's thoughts on this?
Thank you for being part of it.
The information contained in this e-mail is confidential. This e-mail is intended only for the stated addressee. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this e-mail. if you have received this e-mail in error, please inform us immediately and delete it and all copies from your system.
EBS Dealing Resources International Limited. Registered address: 10 Paternoster Square, London EC4M 7DY, United Kingdom. Registered number 2669861.
EBS Dealing Resources, Inc, registered in Delaware. Address: 535 Madison Avenue, 24th Floor, New York, NY 10022, USA, and One upper Pond road, Building F - Floor 3, Parsippany, NJ 07054, USA.
EBS Dealing Resources Japan Limited, a Japanese Corporation. Address: Asteer Kayabacho Bldg, 6th Floor, 1-6-1, Shinkawa, Chuo-Ku, Tokyo 104-0033, Japan.