BDD-style specification reporting in CC.Net
Shortly before I was given the free time I so dearly craved in such a Twilight Zone-esque manner, we had implemented Ryan LaNeve's fancy XSL technique for reporting BDD-style specifications from CC.NET. It gives some neat little feedback for your tests and even works reasonably well for more traditionally-named tests. And the XSL itself is very neatly laid out and easy to follow.
A couple of notes on it that may not be obvious from the post:
- The XSL stylesheet adds a "success" or "failure" class to the test names. So if you load it up and don't immediately see green test names, add CSS rules for those two class names. And try to be more creative than: color:red; font-weight: bold. As a general rule, you can never use too much cyan.
- By default, the XSL will strip out spaces from the test as well as any leading .BaseSetUp. and trailing .TearDown text from the test names. This works if your setup and teardown methods are so named. If not, you'll need to make appropriate changes.
A note about the second point: XSL is case-sensitive. So if you tell the stylesheet to strip TearDown, that's all it will strip. Any teardown methods named Teardown or teardown will still appear. And while XSL 2.0 does offer the ability to do case-insensitive search and replace, to the best of my knowledge, neither Firefox nor IE support it. So you are stuck either with funky templates using translate, or, and this probably more practical, adding checks for all variations of TearDown and SetUp used in your codebase.
Or you could just be consistent with your naming standards.
Kyle the Optional