Several books and papers show how to use mock objects in unit testing. These describe the capabilities that mock objects should have and how to use them.
一些书籍和论文讲述了如何在单元测试中使用模拟对象,描述的是模拟对象应该具备的能力以及如何使用他们。
I hope that you see the benefits of using mock objects in unit testing. I also hope this brief tutorial helps you see how to create mock objects easily.
我希望你们能够发现在单元测试中使用模拟对象的益处,也希望这篇简短的指南能够帮您了解如何简单地创建模拟对象。
As you grow more comfortable using mock objects, you will develop a feel for how much validation responsibility to delegate to the mock.
随着您更加熟练地使用模仿对象,对于将多少验证职责代理给模仿对象,您将会深有体会。
At this stage, the mock object is in record state - that is, you're simply defining the method calls it will expect along the way. So, the mock is recording expectations accordingly.
在此阶段,模拟对象处于记录状态——即简单地定义对象将一直期望的方法调用,因此,模拟将相应地记录期望。
We have seen how simple mock objects can enable repeatable unit testing of a BPEL process, and described a simple framework that greatly eases the construction of mock objects.
我们了解了简单的模拟对象如何实现BPEL流程的可重复单元测试,并描述了一个简单的框架,该框架极大地简化了模拟对象的构造。
Mock object: a subclass (or implementation) of the collaborator that follows the mock object pattern.
模仿对象:遵循模仿对象模式的合作者的子类(或实现)。
Mock objects and mock object controllers.
模拟对象和模拟对象控制器。
The signature of the method is similar to that of the jMock CGLIB mock() method because both methods take on unique mock object identifiers as arguments.
方法的签名类似于jMockCGLIBmock() 方法的签名,因为这两种方法将接纳惟一模拟对象标识符作为参数。
Our mock object will then implement both the service interface of the component it is replacing, plus the controller interface. An outline of a mock object implementation would look like
然后,我们的模拟对象将同时实现它替换的组件的服务接口和控制器接口。
To mock a concrete class, use the mock (Class.class, "identifier") method.
要模拟具体类,则使用mock (class . class,“identifier ”)方法。
Therefore, when you build the mock service you'll mock the Ajax lib calling your GUI back asynchronously.
因此,在构建模拟服务时,要模拟ajax库异步地回调GUI。
The extra String parameter supplied to jMock CGLIB's mock() method is used as an identifier for the mock object created.
提供给jMockCGLIB 的mock()方法的附加String参数被用作创建的模拟对象的标识符。
Some witnesses are even subjected to mock trials prepared by their lawyers, who then interview the mock "jurors" afterward to learn how the testimony of these witnesses was perceived.
有些证人甚至还参加由他们的律师安排的模拟庭审,这些律师随后会询问模拟“陪审员”这些证人的证词效果如何。
The product is capable of capturing SOAP requests and responses to create test requests, test cases and mock up services. The tool can even create WSDLs for these mock up services.
该产品可以捕捉SOAP请求和响应来创建测试请求,测试用例和仿真的服务。
You will almost always use mock object frameworks to mock or stub them.
因此总是需要使用mock对象框架对它们进行mock或stub。
As you see, there is a mock class for the ACLDao that retrieves specific authorizations; this mock DAO USES properties files so that you can test without needing to install a database.
正如您所看到的,这里有一个acldao类型的mock类,用于检索特定授权;此mockDAO使用属性文件,以便可以在不必安装数据库的情况下进行测试。
Summary: The previous mock target was simple, but you can also write mock targets to simulate complex join points (such as cflow ) or sequences of join points that you wish to affect.
概述:上一个mock目标是简单的,但是也可以将mock目标编写为模拟复杂的联结点(如cflow)或者要影响的一系列联结点。
Next, I actually mock the member class and mock a finder that returns mock_member.
接下来,对这个member类和能返回mock_member的查找器进行mock。
Note that in this example, I combine mock targets with mock objects (as described in Section III, Pattern 2).
注意在这个例子中,我结合了mock目标和mock对象(如在第i ii节,模式2中所描述的)。
Mock on, mock on; 'tis all in vain!
嘲笑吧,嘲笑吧,但一切徒劳。
Mock trial is a special law practice, consisting of preparation, mock trial and summarization.
摘要模拟法庭审判是一种特殊的法学实践方法,分为前期准备、模拟庭审、后期总结三个阶段。
The design characteristic and effect of digital mock-up are introduced in this paper, and hardware makeup of a digital mock-up system which get three channel and stereo display is illuminated.
本文简要介绍了数字样机技术的特点和意义,给出了一个三通道、立体显示的数字样机平台的硬件组成。
Mock interviews for these students have begun. There are also other students who would like to be interviewed in the UK, at Cambridge University. Their mock interviews are scheduled for November.
但是申请牛津和剑桥的同学会比其他人的任务更重,他们需要为可能的面试做准备,情绪也会随之兴奋或焦虑。
Mock epic: A comic literary form that treats a trivial subject in the grand, heroic style of the epic. A mock epic is also referred to as a mock-heroic poem.
模仿史诗:以史诗的壮丽、英雄主义的风格针对一件小事所写的一种诗。
Be attended to Mock-up 3D design, Mock-up 2D design, making mobile phone colour samples.
从事手机模型3D建模、外观2D图设计、手机色彩样品配置。
Be attended to Mock-up 3D design, Mock-up 2D design, making mobile phone colour samples.
从事手机模型3D建模、外观2D图设计、手机色彩样品配置。
应用推荐