title: How should you unit test with repository classes in MVC3?
body: <p>I'm trying to do a test on my controllers which get data from repository classes.
  This is the part of the repository I want to test:</p>
  
  <pre><code>public class NewsRepository
  {
      public IEnumerable&lt;NewsItem&gt; GetNews()
      {
          var result = (from n in n_db.NewsItems
                       orderby n.ID descending
                       select n).Take(3);
          return result;
      }
  }
  </code></pre>
  
  <p>Just some small code to get how the testing works.
  In my HomeController I've got this code inside the Index():</p>
  
  <pre><code>    public ActionResult Index()
      {
          ViewBag.Message = "Announcements";
          NewsRepository n_rep = new NewsRepository();
          var model = i_rep.GetNews();
  
          return View(model);
      }
  </code></pre>
  
  <p>I am completely new to testing so all explanations would be great.
  Thanks.</p>