Rhino 的嘲笑有哪些风格?

发布于 2024-09-11 14:57:47 字数 42 浏览 2 评论 0原文

听说最新款式是AAA。还有其他的吗?为什么我们使用一种而不使用另一种?

I heard that latest style is AAA. Is there any other one? Why we use one and don't use another?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

万劫不复 2024-09-18 14:57:47

通过检查模拟和存根之间的差异,可以最好地理解新 AAA 风格和旧记录/重放风格之间的差异。 AAA 使用存根,而录制/重放则使用模拟。

我在此处写了关于差异的博客。

The difference between the new AAA style and the old record/replay style is best understood by examining the difference between mocks and stubs. AAA uses stubs, while record/replay uses mocks.

I have blogged about the difference here.

愁以何悠 2024-09-18 14:57:47

我认为有两种主要风格 - 一种是经典风格(不确定名称是什么) - 从 .Net 的一开始和最早版本就存在(当然我在 .Net 1.1 中使用过它)和 AAA 风格。两者仍然功能齐全,所以请随意使用任何一个(但你不能混合它们 - 它根本不起作用,你会得到奇怪的错误)。

AAA 风格是在 C# 中引入 lambda 表达式和扩展方法之后发展起来的,很多人(包括我)认为它更干净,更容易阅读,并且更好地表达了测试的意图。

I think there are 2 major styles - one is the classic one (not sure what is the name) - which existed from the beginning and the earliest versions of .Net (certainly I used it with .Net 1.1) and the AAA one. Both are still fully functional, so feel free to use any (but you can't mix them - it simply doesn't work and you will get weird errors).

The AAA style was developed after lambda expressions and extension methods were introduced in C# and many people (including me) think it is cleaner, easier to read and expresses the intent of the test better.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文