In a service test, is it better to build complex objects or to mock everything?

21 months ago by

Although in unit tests it's common to mock everything outside the class under test, for service tests it seems more common to build complex objects using the Randomisers and only mock classes that make REST calls. With improvements to the randomisers and the introduction of Factories it can be hoped that building may end up easier than mocking, but are there any general rules-of-thumb for making the decision which approach to use?

Please login to add an answer/comment or follow this question.

Similar posts:
Search »