我们需要创建三个模拟对象类。
一开始,模拟对象看上去令人生畏。
模拟对象和模拟对象控制器。
这通过名为模拟对象的常见测试模式实现。
This is accomplished with the common testing pattern known as mock objects.
我们还提供了一些快速创建模拟对象的技术。
We will also present some techniques for creating mock objects quickly.
模拟对象现在已完成。
创建一个模拟对象类作为具体类中的一个子类。
Create a mock object class as a subclass of the concrete class.
现在我们已使测试对我们的模拟对象使用两个接口。
We now have enabled the tests to use both interfaces to our mock object.
一些模拟对象可以在模拟对象的网站4上中找到。
Some of these can be found on the mock objects' Webpages. 4.
在这些示例中,我们将为每个模拟对象创建单独的模块。
In these examples, we create separate modules for each mock object.
在本文稍后的部分中我们将创建这两个服务的模拟对象。
We will create mock objects for these two services later in this article.
这些测试可让我们直接使用Customer模拟对象。
These tests enable us to exercise the Customer mock object directly.
在深入探讨模拟对象之前,让我们先来看一下以下两点异议。
Let's look at the first two objections before we delve into mock objects.
我们的测试代码,特别是模拟对象,使我们能完全控制数据库结果。
Our test code, specifically the mock objects, give us total control over the database results.
模拟对象必须从l_archive库实现Customer接口。
The mock object must implement the Customer interface from the L_Archive library.
图像符号(ICON)图像符号是通过模拟对象或与对象的相似而构成的。
Image symbol (ICON) image through the mock object symbol or similar object while the composition.
按照单元测试的术语,这称为模拟对象(mock object),更多信息参见参考资料中的链接。
In unit testing language, this is called a mock object (see Resources for more information).
050-CheckNotification然后将验证是否使用正确的数据调用了CustomerCommiunication 模拟对象。
050-CheckNotification will then verify that the CustomerCommiunication mock object was called with the correct data.
清单3给出模拟设备对象的代码。
它只不过是包装了hashmap然后模拟一个真实对象。
It merely wraps around the HashMap and simulates a real business object.
生成客户端实现以收集请求对象并将其传递给模拟器服务。
Create client implementation to gather and transfer the request object to the simulator service.
生成模拟器服务,将业务规则运用到生成的响应对象上。
Create the simulator service that will apply the business rules to the generated response object.
以YC 4108d柴油机为研究对象,构建试验平台,模拟活塞环磨损。
A test platform is built and piston ring wear is simulated in YC4108D diesel engine.
以YC 4108d柴油机为研究对象,构建试验平台,模拟活塞环磨损。
A test platform is built and piston ring wear is simulated in YC4108D diesel engine.
应用推荐