Today I learned how to use "mock objects", which are a super-easy way to create fake objects for testing. You barely have to write any code - just tell the DynamicMockObject what values to return for what method names.
Update: I must say that NMock is better than DotNetMock. Better documentation, more tutorials, more flexible specification of values (IsAnything), rules can be relaxed (SetupResult).
Mock objects rock!
ReplyDeleteI recently started using EasyMock in my JUnits, now I don't think I can do without!
Hi Erik - Thanks for the EasyMock recommendation.
ReplyDelete