how to use mock objects while testing