If you do a lot of Unit Testing with NUnit or other test runners, you may be interested in NMock to create Mock Objects to represent custom objects.
As described on the website, a Mock:
- takes on the interface of another object, allowing it to be substituted for a real one for testing purposes.
- allows Expectations to be setup, specifying how the class under test is expected to interact with the mock.
- fails the test if any of the expectations are violated.
- can also act as a stub, allowing the test to specify objects to be returned from mocked methods.
I haven't tried this myself yet, but I can definitely see this being useful in testing certain areas of my current project that deal with a resource intensive custom object. Rather than dealing with the custom object directly, it sounds like a Mock Object would be much better.
Check out NMock here.