Is it OK to introduce methods that are used only during unit tests?
- by Mchl
Recently I was TDDing a factory method. The method was to create either a plain object, or an object wrapped in a decorator. The decorated object could be of one of several types all extending StrategyClass.
In my test I wanted to check, if the class of returned object is as expected. That's easy when plain object os returned, but what to do when…