I finally took some time today to explore NMock with a collegue. We wanted to unit test a .NET component that was consuming some COM interfaces. This is difficult, since the instances we are dealing with are created by another process, and they are not createable outside that environment. “Mocking” allows us to create an object that looks and behaves like the desired component for a specific condition, as well as provide an indication if the object under test behaved in the expected way.
NMock provides a full framework for mocking, and works well with NUnit, a top-notch unit testing framework. While seeing a great potential for usefulness and making unit testing less painful, I was sad to see that there are some issues that kept it from working in our case:
We'll screw with it some more in the next week or so before giving up. There seems to be much more recent code in SourceForge than is released. Maybe some of the issues are fixed.
Remember Me
Page rendered at Sunday, October 12, 2008 12:46:19 AM (Pacific Standard Time, UTC-08:00)
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.