java mockito 的学习资源
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1404824/
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
learning resources for mockito
提问by Aadith Ramia
i am required to use mockito to create unit testing framework for existing code. I am unable to find a good place to get started with learning Mockito. Could you please point me to a good learning resource for mockito? (online resource or otherwise)
我需要使用 mockito 为现有代码创建单元测试框架。我找不到开始学习 Mockito 的好地方。你能给我指出一个很好的 mockito 学习资源吗?(在线资源或其他方式)
回答by Pascal Thivent
In the "Help me to start" thread on the mockito discussion groupon Google, Szczepan Faber, the project owner of mockito, suggests:
在Google上的mockito 讨论组的“帮助我开始”主题中,mockito的项目所有者 Szczepan Faber 建议:
- the Documentationwhich includes some examples
- Brett L. Schuchert's tutorial
I'd take a look at the posts in the mockito categoryof Szczepan's blogtoo.
我也会看看Szczepan博客的mockito 类别中的帖子。
回答by Anver Sadhat
For a overview about mock and mockito you can refer Mockito-a-great-mock-framework-for-Java-development
有关 mock 和 mockito 的概述,您可以参考Mockito-a-great-mock-framework-for-Java-development
回答by theRiley
a nice succinct overview: http://www.javacodegeeks.com/2012/05/mocks-and-stubs-understanding-test.html
一个不错的简洁概述:http: //www.javacodegeeks.com/2012/05/mocks-and-stubs-understanding-test.html
also, take a close look at the org.mockito.Mockito class itself in the API. most of the base behavior is held therein.
另外,请仔细查看 API 中的 org.mockito.Mockito 类本身。大多数基本行为都保存在其中。

