可选的:创建单元测试以确保原始目标对象的工厂方法仍返回正确的非模仿对象。
Optional: create a unit test to assure that the original target object's factory method still returns the correct, non-mock object.
浅表副本创建与原始对象具有相同类型的新实例,然后复制原始对象的非静态字段。
A shallow copy creates a new instance of the same type as the original object, and then copies the nonstatic fields of the original object.
应用推荐