Ok but in such case, you won't suffer from any perf problems at all if you mark your methods/props as virtual The overhead of virtual calls is non existing when you bring html rendering and database access into the picture.
Lowest of the Low wrote:
In relation to your type 1 mock how would you go about using an interface when the class you are attempting to mock is unique within the app? Or am I just being dense here and you would simply replace the class interface with an explict interface and implement that in the class? Even if you do this it just 'feels' wrong having to create interfaces where a concrete class would work (from an application point of view)
Well if you use them as stubs because your concrete class is not yet written (kind of the purpose of stubs) Then you would create an interface, maybe not because the app absolutely needs it in the end, but because _you_ need it to be able to continue to work before the stubbed class is actually implemented... The interfaces adds value in form of testability which make you able to develop faster and you get an app that is easier to maintain, even if they don't add much value inside the executing application itself.
My Blog
modified on Monday, June 9, 2008 8:01 AM