title: Unit Testing Assemblies Running Out Of Process
body: <p>Anybody out there have experience testing "out of process assemblies"?
  I'm testing some Com+ (Serviced Component) and WCF services configured to be activated out of process and I'm not sure what the best practices are for testing in these situations.  </p>
  
  <p>What I've done is given the public classes their own IOC container that they can build up upon activation. This works fine but I run into problems as soon as I try and unit test for 2 reasons...</p>
  
  <ol>
  <li><p>Any dependency object I want to inject needs to be serializable because the unit tests are running in a different process.  If I want to load an additional module (ninject) into to com+ kernel / ioc container I need to write my own to make it serializable.  I don't feel comfortable making things serializable just to do tests.</p></li>
  <li><p>Out of process assemblies need to be installed into the GAC, and in the case of Com+ need to be registered.  That makes testing a pain since they will need to be installed before they are tested.</p></li>
  </ol>
  
  <p><strong>I can only think of two ways to approach this at the moment.</strong></p>
  
  <ol>
  <li><p>Have a separate working copy for running tests where I've modified the configuration to run the assemblies in process.  Obviously this isn't ideal because now I'm modifying code just to make it testable.  Although I could live with this because it doesn't involved any functional changes.</p></li>
  <li><p>Have the unit test inherit from the Com+ or WCF component so the tests can run in the same process boundary.  (This would require the unit test to be installed into the GAC)</p></li>
  </ol>