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. 

你可能感兴趣的:(Class)