title: Moq Returns method returns null
body: <p>I'm new to Moq and trying to get my mock to return a value in ASP.NET MVC. Docs <a href="http://www.nudoq.org/#!/Packages/Moq/Moq/IReturns(TMock,TResult)/M/Returns(T)" rel="nofollow">here</a>. Code:</p>
  
  <pre><code>mock = new Mock&lt;IRepository&lt;Story&gt;&gt;();
  
  mock.Setup(x =&gt; x.GetById( It.Is&lt;int&gt;( i =&gt; i==10 ) ))
      .Returns(It.Is&lt;Story&gt;((Story story) =&gt; story.Id == 10 &amp;&amp; story.Hits == 0));
  
  storiesController = new StoriesController(mock.Object);
  
  ViewResult result = storiesController.Details(10) as ViewResult;
  </code></pre>
  
  <p>and <code>Details</code> method calls <code>storyRepository.GetById(id)</code></p>
  
  <p>and this test fails:  <code>Assert.IsNotNull(result);</code> because <code>GetById</code> method returns null.</p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>        public ActionResult Details(int? id)
          {
              if (id == null)
              {
                  return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
              }
              Story story = storyRepository.GetById(id);
              if (story == null)
              {
                  return HttpNotFound();
              }
              story.Hits++; // TODO!
              storyRepository.Update(story);
              storyRepository.Save();
              return View(story);
          }
  </code></pre>
  
  <p>This is the Details method. In debug mode I see the fetched Story is null as soon as I step over the called GetById method.</p>