Moq和Rhino.mocks有什么功能? [英] What are the capabilities of Moq and Rhino.mocks?

查看:83
本文介绍了Moq和Rhino.mocks有什么功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到Moq和Rhino的逐项特定功能比较.所有问题都是您更喜欢哪个,为什么?",或者这是您如何在犀牛中进行简单的模拟以及如何在最小定量中完成".

I cannot find a specific feature-by-feature comparison of Moq and Rhino. All the questions are "which do you like better and why", or "here's how you do a simple mock in rhino and how it's done in moq".

我在任何地方都找不到深入的比较.我知道语法上的差异,因此我没有在寻找答案. 我正在寻找功能比较 .例如:

I cannot find a deep comparison anywhere. I'm aware of the syntax differences, I'm not looking for answers about that. I am looking for a capability comparison. For example:

  • Rhino具有线程的Expect.On() 嘲笑. Moq可以这样做吗?

  • Rhino has Expect.On() for threaded mocking. Can Moq do this?

如何进行多模拟 (实现多个接口 与一个模拟). Moq可以这样做吗?

What about Multi-mocking (implementing multiple interfaces with one mock). Can Moq do this?

我相信Moq现在可以嘲笑受保护的成员. Rhino可以这样做吗?

I believe Moq can now mock Protected members. Can Rhino do this?

编辑:我最终也查看了其他一些.Net框架.

Edit: I ended up looking at some of the other .Net frameworks as well.

推荐答案

感谢那些在过去几周内做出回应的人.我最终写了一篇关于我的发现的博客文章,因为我不得不做大量的挖掘工作,以至于我似乎最好总结一下它们,以期帮助他人.我发布的图表整理了我的发现:

Thanks to those that responded over the last few weeks. I ended up writing a blog post about my findings, since I had to do so much digging that it seemed like I might as well summarize them in the hopes of helping others. The chart I posted organizes my findings:

我在博客文章中提到的一个警告是,该图表对于检查功能很有用,但是大多数框架的真正优势在于它们的独特功能.最后,由于易于使用的API,我选择了Moq.此外,所有信息均可能会发生错误且会有所更改-如果您不同意图表中的内容,请发表评论.

One caveat, which I touched on in the blog post, is that the chart is useful for checking the capabilities, but the real advantages to most frameworks are their unique features. I chose Moq in the end because of the easy to use API. Also, all the information is subject to errors and change - if you disagree with something on the chart, please post a comment.

这篇关于Moq和Rhino.mocks有什么功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆