title: Unit Testing ASP.NET MVC Project that Has a Database Connection String Defined in Web.Configuration.WebconfigurationManager
body: <p>I have an ASP.NET MVC project that I would like to unit test.  Most of the functions rely on a call to our database, who's connection string is defined as:</p>
  
  <pre><code>connStr.ProviderConnectionString = Web.Configuration.WebConfigurationManager.ConnectionStrings("ApplicationServices").ConnectionString
  </code></pre>
  
  <p>Is there some way to easily test this without making each unit test fire off the dev server with:</p>
  
  <pre><code> &lt;TestMethod(), _
   HostType("ASP.NET"), _
   AspNetDevelopmentServerHost("C:\Users\tyler.HQ\Development\LateralSports\Dev\Dev\Site", "/"), _
   UrlToTest("http://localhost:57110/")&gt; _
  </code></pre>
  
  <p>Using the <code>HostType</code> allows the unit tests to run, but it is super slow.  </p>
  
  <p>Is there some configuration parameter I can swap around?</p>
  
  <p>Thanks</p>