During this semester my professor tried to convince us why is good to use unit tests during development, why is it good to validate data(Microsoft Application Block) and also he told us about using mocking(RhinoMocks) in order to test our methods when we didn't had access to a database.
I had to do some unit tests with mocking and in order to make them work i had to create by hand the objects hierarchy that was needed in order to test my method(It took me a while to write everything i needed).
The question that i want to put: in production is it useful to use mocking? Should i use it every time i have the chance? And also the effort made to write everything in order to test a method with mocks does it pay off?
thank you