Hi, I would test that the interface is not null. And that the functionality of the class (via interface) is correct.
As for class inheritance, you should only expose constructors in the base class, and any additional constructors that require additional information. Passing a magic number seems to be an anti pattern. Either create a constructor in the base class that sets the magic number and then add a constructor that takes a parameter or remove the magic number completely. For what you have described ask the question: If the magic number should be 3 instead of 4, how do I test this? .02€ Davy "When all you have is a hammer, every problem looks like a nail." I feel much the same way about xml -----Original Message----- From: Tristan Reeves <tree...@gmail.com> Sender: ozdotnet-boun...@ozdotnet.com Date: Sun, 5 Jun 2011 17:06:27 To: ozDotNet<ozdotnet@ozdotnet.com> Reply-To: ozDotNet <ozdotnet@ozdotnet.com> Subject: unit testing gone mad Hi list, I'll describe the situation in as little detail as possible. There's some code in which a class BaseClass, and a class ClassForUse : BaseClass are defined. BaseClass is used in a unit test that calls its constructor with mocks. ClassForUse is used in production with a 0-param constructor which calls the base constructor with hard-coded arguments. Forgetting (for now) any issues with all this (and to me there are plenty), we then find the following unit test: [Setup] var _instance = new ClassForUse(); [Test] Assert.That(_instance is BaseClass); ...to me this is totally insane. But I seem unable to articulate exactly the nature of the insanity. A little further on we have (pseudocode) [Test] Assert _instance._MemberOne is of type A Assert _instance._MemberTwo is of type B Assert _instance._MemberThree is of type C where the members are (if not for the tests) private members set by the 0-param constructor which pushed them into the base constructor. (all hard coded). So...is this really insane, or is it I who am crazy?? It's made more perplexing to me because the author of this code says it's all a natural result of TDD. And I am far from a TDD expert. I would love some feedback about this Modus Operandi. esp. any refs. It seems obviously wrong, and yet I am unable to come up with any definitive argument. Thanks, Tristan.