title: Using xml transformations in unit tests
body: <h2>Background:</h2>
  
  <p>Currently we have around 10 unit/integration test projects that hit a database to do tests.  Each test class that hits the database inherits from a class called <code>IntegrationTest</code> which is in a seperate dll called <code>TestBase</code>. <code>TestBase</code> contains a configuration file (nhibernate_log4net.cfg.xml) that houses the connection string to the database. </p>
  
  <p>Our development team is a group of about 7 or 8.  If two team members were to run the unit tests at the same time there would be conflicts because a lot of the tests are adding and deleting data that is common across many tests.  This would cause tests to fail erroneously between the two developers.</p>
  
  <h2>Layout:</h2>
  
  <p><strong>TestBase.dll</strong><br>
  IntegrationTest.cs  (Contains <strong>[DeploymentItem("nhibernate_log4net.cfg.xml"]</strong>)<br>
  nhibernate_log4net.cfg.xml<br>
  nhibernate_log4net.cfg.Developer 1.xml  (Transformation file)<br>
  nhibernate_log4net.cfg.Developer 2.xml  (Transformation file)<br>
  ...</p>
  
  <p><strong>UnitTest.dll</strong><br>
  References -> <strong>TestBase.dll</strong><br>
  MyUnitTest.cs (Inherits from IntegrationTest in <strong>TestBase.dll</strong>)  </p>
  
  <h2>Problem:</h2>
  
  <p>My idea was to use <code>SlowCheetah</code> xml transformations on the configuration file in the <code>TestBase</code> dll for each developer in the team but the transformed file does not get copied to the <strong>Out</strong> directory of the unit test. The base configuration file (non transformed one) is the one that gets copied out to the <strong>Out</strong> directory.  I have a feeling it's because of the <code>[DeploymentItem("nhibernate_log4net.cfg.xml")</code> attribute I have to use to get the config file out there in the first place.</p>
  
  <p><strong>Is there any way to use xml transformations on an xml config file that is included in a separate dll than the unit testing project?</strong></p>