unit testing and mocking frameworks
If you know me, you'll know that I am the last one to advocate unit tests :)
I have always disliked them for the simple fact, that in a real project, you have to do a TON of wire up just to get the unit test to work. Connect to a db most of the time, do a bunch of setup etc etc. I usually find that the tests take almost as much time to code as the actual app.
Well recently a friend of mine told me to check out TypeMock. I had never heard of mocking frameworks before. It was a new experience.
After getting a copy, I started looking at what it does to help fix all the problems I find with unit tests. It allows you to "mock" any object in your system. Mocking means that it will intercept calls to your real objects and return "fake" objects for you to use in your testing.
For instance, say I want to test a class that does calculations. In that class, a call is made to the database to fill out some basic numbers in the class that are used to perform the calculations. With standard testing you have to wire up the db call, make sure you have a good db etc, just to test the calculate method. With TypeMock, I can intercept the call to the db object and return any value I want. IE the calculate class thinks it hit the db and now my unit test can just test the calculations to see if they're right.
It has a ton of features, way to many to list here, but some that stood out are the ability to mock a whole object, specific functions of an object, specific properties, multiple return values depending on input, a reflection module so you can mock anything, even if it isn't public and many others.
I highly suggest you check it out if you do unit tests, or you were like me and didn't like them.
http://www.typemock.com/