Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (11 sloc) 1.65 KB
---
layout: post
title: Yet another reason to love TestDriven.net
date: '2009-05-06T13:55:00.001+01:00'
tags: [tdd]
modified_time: '2009-05-06T13:55:17.748+01:00'
blogger_id: tag:blogger.com,1999:blog-4015568221071268916.post-3034714963951731977
comments: true
blogger_orig_url: http://serialseb.blogspot.com/2009/05/yet-another-reason-to-love.html
---
<p>As I was coding some new tests for the container integration part of OpenRasta (which, since beta 2 changes, has become much more complicated…), I discovered a feature I didn’t even realize was there.</p> <p>I use abstract test classes so that each container that OpenRasta supports automatically gains any new tests that verify the behaviour of the container matches OR’s expectations. In an abstract test, the test class that contains the test is marked abstract, and you inherit from that class for each specific set of tests you can run. I’ve used that trick for a long time, and was one of the main reasons why I didn’t like MSTest much, as it seems the guys in Redmond didn’t support that scenario.</p> <p>So here I was, coding away in an abstract class, and frenetically executing the test as I added code (something I remapped to Ctrl+T, T). Then it dawned on me that I was attempting to execute the abstract class. But surely, an abstract class can’t be instantiated I told myself.</p> <p>And then I realized what was happening. TD.net was simply executing the concrete classes inheriting from my test class. Sweet.</p> <p><em>PS: I have no idea if it’s the runner or nunit, and have no idea either if other runners will or won’t execute this scenario. It just works and that makes me happy :)</em></p>