title: Inter-service Communication Architecture Using WCF, Dependency Injection, and Unit Testing
body: <p>I'm new to WCF and in a large part, also distributed programming.  I am working on a project that requires 4 discrete services.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>When I am unit testing service B, I must have A's service host up and running.</p>
  
  <ol>
  <li>Is this the wrong way of going about dependency injection?  If so, why, and how do you recommend I do it?</li>
  <li>Is there a better way of going about dependency injection?</li>
  <li>Should I have to run the service host to get the right results in the unit test?</li>
  </ol>