Unit Testing Mock/Stub definitions in Moq

后端 未结 4 670
终归单人心
终归单人心 2021-02-07 16:12

Any reading or advice I\'ve been given on Unit Testing has always suggested a distinct difference between the definition of a Mock and a Stub. My current understanding of these

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-07 16:43

    Martin Fowler wrote a good article, Mocks Aren't Stubs, which I think makes the distinction clear.

    Mocks are used for behavior verification, while stubs supply fake data and normally participate in state verification.

提交回复
热议问题