title: Design MVC Controller using TDD for database calls
body: <p>I am new to MVC and unit testing. I need to do unit testing on my controllers but I'm afraid I may not have them setup properly.  </p>
  
  <p>For example:</p>
  
  <pre><code>public class MyController
  {
       public ActionResult Index(int id)
       {
           var locations = new MyLocations().GetLocations();
           //linq code here that filters based on id
           return View(filteredLocations)
       }
  }
  </code></pre>
  
  <p>This is a really simple example, but how would I set this up correctly so that I could use the TDD model so that when I unit test I can provide a static list of locations as the return value? </p>
  
  <p>I am unsure on how this should be properly structured.</p>