Thanks for the advice. A had a quick look at NMock, as well as at EasyMock (but not well documented), .NET MockObjects (not documented at all), and Rhino Mock.
However, all seem to have the same 'problem': you need special code in your testcode to setup mock objects. As far as I could see based on the online documentation, to create a NMock mock object, you need to write: Mock mock = new DynamicMock(typeof(Something)); // create a mock Although this is very clean, it requires code that is designed to be tested and mocked. The problem I face is that I need to create tests for this code without really changing the code (although allowing attribute decorations would be allowed). In an attempt to solve this with 'transparent mocking' I merely would like to know how to intercept a constructor call and return another - compatible - instance. And I can think of other applications for this as well, so mocking is not the issue. But anyway, thanks again for your suggestion. =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
