TDD:simply mocking a class is not necessarily the best practice

simply mocking a class is not necessarily the best practice either—it might be better to refactor the code so that all the information the method needs is obtained separately, separating out the acquisition of the data from the computation of the data. 

原文地址:https://www.cnblogs.com/happyframework/p/3934993.html