C# 最佳模拟库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/80067/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 11:17:55  来源:igfitidea点击:

Best Mocking Library

提问by cvs

Which is the best mocking library for C# 3.0/ ASP.NET MVC? Why?

哪个是 C# 3.0/ASP.NET MVC 的最佳模拟库?为什么?

回答by Dean Poulin

Moq

起订量

It's amazing, fully supports the new language features of C# 3.0 and it's very easy to get going with. I would highly recommend it.

它非常棒,完全支持 C# 3.0 的新语言特性,而且非常容易上手。我会极力推荐它。

回答by Ash

Very subjective question. What do you mean by "best"? Maybe you should provide some more context on your situation.

很主观的问题。你说的“最好”是什么意思?也许你应该提供更多关于你的情况的背景信息。

RhinoMocksis one of the most popular, as to whether it's the best for you, who knows?

RhinoMocks是最受欢迎的软件之一,至于它是否最适合您,谁知道呢?

回答by johnc

I'm going through that process now, weighing them up for use by my team, and I have to say Moq as well, it seems to have the least of a learning curve, and some nice features, I love the use of Moq generics to specify a Mock class

我现在正在经历这个过程,权衡它们以供我的团队使用,我也不得不说 Moq,它似乎有最少的学习曲线,还有一些不错的功能,我喜欢使用 Moq 泛型指定一个 Mock 类

回答by Dean Poulin

there's also this other post about this topic:

还有关于这个主题的另一篇文章:

Best mock framework that can do both WebForms and MVC?

可以同时执行 WebForms 和 MVC 的最佳模拟框架?