您可以将模仿对象测试与各种技巧和技术组合起来。
You can combine mock object testing with a variety of techniques and technologies.
这需要考虑到使用动态模仿对象的可靠测试策略。
This allows for a reliable testing strategy that USES dynamic mock objects.
模仿对象符合实际对象的接口,但只要有足够的代码来“欺骗”测试对象并跟踪其行为。
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.
Wicket通过使用内置的模仿对象框架提供对容器外单元测试的支持。
Wicket supports out-of-container unit testing through the use of a built-in mock object framework.
虽然这种模式对于许多情况都非常有效,但模仿对象有时不能被传递到正在测试的对象。
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.
在特殊化对象中,覆盖创建方法以返回为测试提供的模仿对象。
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.
应用推荐