尤其是,我的设计利用了模仿对象来简化测试。
In particular, my design employed mock objects to make testing easier.
测试代码希望它产生另一种类型的对象(模仿对象)。
The test code would like it to produce a different type (a mock).
正如您在测试一节看到的,模仿对象方法完全满足该目标。
As you'll see in the Testing section, a mock-objects approach perfectly matches the goal.
使用模仿对象进行测试的常用编码样式是。
The common coding style for testing with mock objects is to.
对象模仿是一种非常流行和通用的单元测试方式。
Mock objects are very popular and common approach to a unit testing. According to Wikipedia
在测试代码中,创建模仿对象且实现与合作者相同的接口。
In your test code, create a mock object implementing the same interface as the collaborator.
在测试代码中,创建模仿对象且实现与合作者相同的接口。
In your test code, create a mock object implementing the same interface as the collaborator.
应用推荐