jstntime75 / Guidant.Demo

0 stars 0 forks source link

Both Portal and Service have dependency on the database / webservice #1

Open apryiomka opened 8 years ago

apryiomka commented 8 years ago

You use RestUtility in the Portal and GuidantExerciseEntities in the web API which both are IO operations and require either a web service or a database. How would you write unit tests for your controllers?

jstntime75 commented 8 years ago

well in this design the tests would need to be integration tests and not unit tests. however this could be overcome with a design in which IO operations are contained within an interface and implementation, so that you could use dependency injection in a unit test for mock results.