Have a collaborator stand at the exit.
让一位合作者站在出口处。
Problem: The object being tested creates a collaborator object.
问题:正在测试的对象创建了合作者对象。
In your test code, create a mock object implementing the same interface as the collaborator.
在测试代码中,创建模仿对象且实现与合作者相同的接口。
Instead, that object is designed to either create, look up, or otherwise obtain its collaborator.
而设计该对象是为了创建、查找或获得其合作者。
We are the best collaborator forever.
我们永远是最好的合作伙伴。
Collaborator is the class you must mock appropriately.
Collaborator是必须正确模拟的类。
The Collaborator class constructor is still quite simple.
Collaborator类构造函数仍然十分简单。
The only way of instantiating the Collaborator object is to provide two simple arguments.
实例化Collaborator对象的惟一方法是提供两个简单参数。
The only way of instantiating the Collaborator object is to provide two simple arguments.
实例化Collaborator对象的惟一方法是提供两个简单参数。
应用推荐