It's interesting to see the other mocking frameworks as they grow into maturity. Especially Moq which has been getting loads of new features recently. The latest one is something which makes me feel a bit weird after reading all the things people fear in Typemock Isolator:It seems that Moq now allows mocking protected fields.
What's really interesting is that Daniel has chosen to actively allow this, and hide the feature at the same time, as well as put it under a strict optional request:
you have to opt in for each code file where you'd like this ability by adding a special imports statement.
So, the questions I have are:
- What happened to "if it's not testable it's a design smell"? Is this a compromise or have people figured out that good design can take many forms, with tools being left to do the hard lifting?
- If you're going to add powerful "non classic" mocking ability to a framework, does adding it as a special "opt-in" feature make it OK? (this is what we are talking about doing with Typemock Isolator)
- If tomorrow Rhino.Mocks were to add the same feature or something even more powerful (statics?) how would people treat that?