伪对象可以是您所需要的任何对象。
这就是伪对象—一种用来伪装测试中对象的轻量型方式。
That's what a sham object is — a lightweight way to fake things out in your tests.
有时我所希望的是一个伪对象,它实现了与真实对象相同的接口,可以回答关于我在测试中如何与它交互这样一些特定问题。
Sometimes all I want is a fake object that implements the same interface and can answer some specific questions about how I interact with it in a test.
应用推荐