title: ASP.NET MVC TDD (xUnit) - failing ConfigurationManager.AppSettings for no reason
body: <p>I am trying to get familiar with TDD concept and wrote a first test that its "act" part looks like this:</p>
  
  <pre><code>repositoryStub = new Mock&lt;IMyRepository&gt;();
  var sut = new MyController(repositoryStub.Object);
  var result = sut.Index() as ViewResult;
  </code></pre>
  
  <p>The controller (<code>MyController</code>) that I am instantiating eventually (deep down) uses <code>ConfigurationManager.AppSettings</code>, while creating view model. The instantiation of the controller fails on the line that is trying to read from Web.Config, but, obviously, runs as expected if project is just run from IDE.
  I am reading a constant from web.config file, which should not affect the test and it wasn't expected that it will fail once called from another (<code>MyProject.Test</code>) project.</p>
  
  <p>My question to you guys is how to overcome this obstacle? </p>
  
  <p>I don't know if it matters here, but just in case, I am using <code>xUnit</code> for TDD.
  Thanks!</p>