What are the real-world pros and cons of each of the major mocking frameworks?

前端 未结 7 488
梦如初夏
梦如初夏 2020-12-04 17:20

see also \"What should I consider when choosing a mocking framework for .Net\"

I\'m trying to decide on a mocking framework to use o

7条回答
  •  萌比男神i
    2020-12-04 17:39

    I use TypeMock since I'm developing on SharePoint. As TypeMock can mock anything, it's proved a valuable resource when unit testing our SharePoint webparts, event recievers, workflows, etc.

    On the downside, TypeMock can be expensive, however there is a version available which is specific for SharePoint and costs less then the full TypeMock package. I highly recommend it.

    The one thing I do disagree with is this notion that TypeMock does not make you design your code very well. Often the classes I create, and overall code, are designed well. Just because I use TypeMock doesn't mean I sacrifice the quality of my design - I still practise IoC and SRP. Just because TypeMock can mock anything does't mean I write my code to reflect that ability.

提交回复
热议问题