Menu

Welcome to discuss

discuss
2003-07-09
2004-01-15
  • Nobody/Anonymous

    Welcome to discuss

     
    • Anonymous

      Anonymous - 2004-01-14

      In chapter 12, page 392-393:  I am still unclear of the difference between the Mock.expectAndReturn() and Mock.matchAndReturn().  I looked through the javadocs for jMock and DynaMock but no explanation existed (just the method signature).  Does anyone know where to locate more complete documentation on either of these frameworks ?

       
      • Vincent Massol

        Vincent Massol - 2004-01-15

        Hi Ken,

        expectAndReturn() expects the call to be made and will generate an exception if the call doesn't happen before the verify() method on the mock is called. Also, you'll need as many expect calls as there are calls to the method mocked.

        matchAndReturn() simply states to return such value whenever such method is called, whatever the number of times the method is called.

        Thanks
        -Vincent

         

Log in to post a comment.