Currently only interfaces can be mocked. The ability to mock classes can be useful in a number of cases. For more information see thread at:
I've attached a work-in-progress patch to support class mocking in NMock2. The patch was made from the trunk folder, revision 71. The zip file contains the patch and two assemblies that need to be added to the lib folder.
This new functionality is built on top of Castle DynamicProxy2 (RC3), which is doing all the heavy lifting in terms of proxy creation and method interception.
I've made a start on fleshing out the test suite to cover these changes, but more work is required.
File Added: ClassMockingPatch.zip
Patch for adding class mocking support to NMock2
File Added: ClassMockingPatchV2.zip
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.