Moq 和 Rhino.mocks 的功能是什么? [英] What are the capabilities of Moq and Rhino.mocks?
问题描述
我找不到 Moq 和 Rhino 的具体功能比较.所有的问题都是你更喜欢哪个以及为什么",或者这是你如何在 rhino 中做一个简单的模拟以及它是如何在 moq 中完成的".
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() 用于线程嘲笑.起订量可以吗?
Rhino has Expect.On() for threaded mocking. Can Moq do this?
Multi-mocking 怎么样(实现多个接口一个模拟).起订量可以吗?
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:
我在博文中提到的一个警告是,图表对于检查功能很有用,但大多数框架的真正优势在于它们的独特功能.我最终选择了 Moq,因为 API 易于使用.此外,所有信息都可能出现错误和更改 - 如果您不同意图表中的某些内容,请发表评论.
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屋!