title: Moq override previous setup?
body: <p>Hi I am trying to set an mock of a class's method with two possible input. When i check output only the last set up return expected output. The first one did not. Any help is much appreciated.</p>
  
  <pre><code>[Test]
  public void ClimbOnceTwoNeighbour_Sample()
  {
      stateConverter = new Mock&lt;StateConverter&gt;();
  
      solution = new Mock&lt;Solution&gt;();
      state = new Mock&lt;State&gt;();
  
      var neightbourSolution1 = new Mock&lt;Solution&gt;();
      var neighbourState1 = new Mock&lt;State&gt;();
      var neightbourSolution2 = new Mock&lt;Solution&gt;();
      var neighbourState2 = new Mock&lt;State&gt;();
  
      stateConverter.Setup(x =&gt; x.FromSolution(neightbourSolution1.Object, It.IsAny&lt;State&gt;())).Returns(neighbourState1.Object);
      stateConverter.Setup(x =&gt; x.FromSolution(neightbourSolution2.Object, It.IsAny&lt;State&gt;())).Returns(neighbourState2.Object);
  
      var state1 = stateConverter.Object.FromSolution(neightbourSolution1.Object, state.Object);//return null ????
      var state2 = stateConverter.Object.FromSolution(neightbourSolution2.Object, state.Object);//return neighbourState2.Object)
  
  
      Assert.AreEqual(neighbourState2.Object, state2);//pass test here
      Assert.AreEqual(neighbourState1.Object, state1);//fail here due to null is returned from previous statement
  
  }
  </code></pre>