I'm new to WCF and in a large part, also distributed programming. I am working on a project that requires 4 discrete services.
I am trying to correctly define the responsibilities for each component of each service. Suppose I have service B which needs to communicate with service A. For each service, I have defined the service implementation class, the service host, and a proxy class.
In order to unit test, I am using dependency injection - since service B needs to communicate with service A, I have passed an instance of A's proxy class as a constructor argument to service B.
When I am unit testing service B, I must have A's service host up and running.
- Is this the wrong way of going about dependency injection? If so, why, and how do you recommend I do it?
- Is there a better way of going about dependency injection?
- Should I have to run the service host to get the right results in the unit test?