jeudi 19 novembre 2015

Setting up complex object that contain circular references to other complex objects for Unit Testing

I am unit testing a business service that depends upon other repository interfaces and service interfaces. These dependencies return complex objects that contains circular references to others complex objects. I am using MOQ to mock these dependencies and setting up their routines to return complex objects. Then I am verifying that the business service under test is returning the correct results.

Due to the complexity of these complex objects, is it a good idea to create a JSON file that represents these complex objects and deserialize it into the mock objects I am settings up? What are your thoughts?

Aucun commentaire:

Enregistrer un commentaire