您可以将模仿对象测试与各种技巧和技术组合起来。
You can combine mock object testing with a variety of techniques and technologies.
尤其是,我的设计利用了模仿对象来简化测试。
In particular, my design employed mock objects to make testing easier.
这需要考虑到使用动态模仿对象的可靠测试策略。
This allows for a reliable testing strategy that USES dynamic mock objects.
在测试代码中,创建模仿对象且实现与合作者相同的接口。
In your test code, create a mock object implementing the same interface as the collaborator.
模仿对象符合实际对象的接口,但只要有足够的代码来“欺骗”测试对象并跟踪其行为。
A mock object conforms to the interface of the real object, but has just enough code to fool the tested object and track its behavior.
模仿对象用来单独测试代码逻辑的一部分。
Mock objects are used to test a portion of your code logic in isolation from the rest of the code.
使用模仿对象进行测试的常用编码样式是。
The common coding style for testing with mock objects is to.
Wicket通过使用内置的模仿对象框架提供对容器外单元测试的支持。
Wicket supports out-of-container unit testing through the use of a built-in mock object framework.
对象模仿是一种非常流行和通用的单元测试方式。
Mock objects are very popular and common approach to a unit testing. According to Wikipedia
虽然这种模式对于许多情况都非常有效,但模仿对象有时不能被传递到正在测试的对象。
While this pattern is very effective for many cases, sometimes the mock object cannot be passed into the object being tested.
模拟对象将模仿出于指导代码执行的惟一目的而编写的类的行为,以便它在测试时符合代码执行要求。
Mock objects mimic the behavior of classes written with the sole purpose of guiding code execution so that it falls within those areas under test.
正如您在测试一节看到的,模仿对象方法完全满足该目标。
As you'll see in the Testing section, a mock-objects approach perfectly matches the goal.
测试代码希望它产生另一种类型的对象(模仿对象)。
The test code would like it to produce a different type (a mock).
在特殊化对象中,覆盖创建方法以返回为测试提供的模仿对象。
In the specialization object, override the creation method to return a mock object that accommodates your test.
可选的:创建单元测试以确保原始目标对象的工厂方法仍返回正确的非模仿对象。
Optional: create a unit test to assure that the original target object's factory method still returns the correct, non-mock object.
KentBeck将模拟对象描述为测试对象,该对象可以使用常量进行响应,从而实现开销大或复杂的资源的模仿版本。
Kent Beck describes a mock object as a testing object, one that implements a fake version of an expensive or complicated resource by answering constants.
KentBeck将模拟对象描述为测试对象,该对象可以使用常量进行响应,从而实现开销大或复杂的资源的模仿版本。
Kent Beck describes a mock object as a testing object, one that implements a fake version of an expensive or complicated resource by answering constants.
应用推荐