What should I consider when choosing a mocking framework for .Net

后端 未结 8 2016
梦如初夏
梦如初夏 2020-12-12 18:20

There are lots of mocking frameworks out there for .Net. There is no clear winner that has superseded the others in every way. The leading mocking frameworks also have many

8条回答
  •  清歌不尽
    2020-12-12 18:58

    RhinoMock is pretty much the state-of-the art mocking framework for .NET. Can't go wrong with it. I guess you can view its "style" as a "Jack of all trades" if you so wish.

    From their web site:

    What does Rhino Mocks offer?

    • Explicit record & replay model for expectations.
    • Natural Arrange, Act, Assert syntax
    • Support for .Net 2.0 and .Net 3.5
    • Working with strongly typed mocks.
    • Setting actions on methods, return spesific value, or throw an exception.
    • Expectations based on:
      • Arguments matching
      • Constraints matching
      • Custom callback to verify the expected arguments using your own code

提交回复
热议问题