Tuesday, July 17, 2012

Mock Object

Mock objects are a useful way to write unit tests for objects that act as mediators. Instead of calling the real domain objects, the tested object calls a mock domain object that merely asserts that the correct methods were called, with the expected parameters, in the correct order. However, when the tested object must create the domain object, we are faced with a problem. How does the tested object know to create a mock domain object instead of the true domain object? In this article, software consultants Alexander Day Chaffee and William Pietri present a refactoring technique to create mock objects based on the factory method design pattern.

5 comments:

  1. Thanks for sharing this unique information with us. Your post is really awesome. Your blog is really helpful for me..
    organic oil
    organic oil in jaipur
    organic cold pressed oils
    ayurvedic oil store in jaipur

    ReplyDelete
  2. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..
    best rpa training in bangalore
    rpa training in bangalore | rpa course in bangalore
    RPA training in bangalore
    rpa training in chennai
    rpa online training

    ReplyDelete

ShareThis