Moq的用途是什么? [英] What is use of Moq?

查看:124
本文介绍了Moq的用途是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在DotNetKicks等上看到这一点……但是无法确切地找到它(用英语)还是它的作用?您能解释一下它是什么,还是我为什么要使用它?

I keep seeing this referred to on DotNetKicks etc... Yet cannot find out exactly what it is (In English) or what it does? Could you explain what it is, or why I would use it?

推荐答案

Moq 是用于C#/.NET.它在单元测试中用于将要测试的类与其依赖项隔离开,并确保对依赖对象的正确方法进行了调用.有关模拟的更多信息,您可能需要查看模拟对象上的Wikipedia文章.

Moq is a mocking framework for C#/.NET. It is used in unit testing to isolate your class under test from its dependencies and ensure that the proper methods on the dependent objects are being called. For more information on mocking you may want to look at the Wikipedia article on Mock Objects.

(用于.NET的)其他模拟框架包括 JustMock RhinoMocks nMock 等.

Other mocking frameworks (for .NET) include JustMock, TypeMock, RhinoMocks, nMock, .etc.

这篇关于Moq的用途是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆