问题描述
您能否推荐一本关于 C# 的单元测试和 TDD 的书,其中至少对 Mock 对象进行了一些处理?
Can you recoment a book on on Unit Testing and TDD for C# with at least some treatment of Mock Objects?
我看过这个问题,但似乎没有提到嘲笑.
I have seen this question but it does not seem to mention mocking.
推荐答案
单元测试的艺术:使用 .NET 中的示例 作者:Roy Osherove (亚马逊页面, 官方网站) 听起来像你要找的东西.他用一章介绍存根和模拟对象的概念(使用自己动手"的方法),然后用第二章介绍使用模拟对象框架,特别是 Rhino Mocks.对测试驱动开发的重视程度稍低,但可以从其他来源获得大量有关 TDD 的信息,而且 TDD 并不是特定于语言的.
The Art of Unit Testing: With Examples in .NET by Roy Osherove (Amazon Page, Official Site) sounds like what you're looking for. He devotes one chapter introducing the concepts of stub and mock objects (using a "roll-your-own" approach), and then a second chapter on using mock object frameworks, particularly Rhino Mocks. There is somewhat less emphasis on Test-Driven Development, but there is quite a lot of information about TDD available from other sources, and TDD isn't all that language-specific.
这篇关于什么关于 C# 的 TDD 和 Mocks 处理的书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!