title: How to set a property on a mock in C# and Rhinomocks?
body: <p>I am having problems setting the value of a property in Rhinomocks. I need to set the initial value of the property outside the method under test and then set its value inside the method under test conditionally. Some code:</p>
  
  <pre><code>public interface IResponse
  {
      string ResponseText { get; set; }
  }
  
  public void ProcessResponse(IResponse response)
  {
      if(response.ResponseText == "Unset")
      {
          response.ResponseText = someService.GetResponse();//someService here is irrelvant to the question
      }
  }
  
  [TestMethod]
  public void ResponseValueIsSetWhenConditionIsTrueTest()
  {
      var mock = Mock&lt;IResponse&gt;.GenerateMock();
      mock.Stub(x =&gt; x.ResponseText).Returns("Unset");
  
      Processor.ProcessResponse(mock);
  
      Assert.AreEqual("Responseval", mock.ResponseText); //Fails because the method doesn't set the value of the property.
  }
  </code></pre>
  
  <p>I need the mock's property to have an initial value going into the Act part of the test, and allow the method under test to change that value so I can assert on it later. However <code>mock.ResponseText</code> is always set to "Unset", and the method never changes its value - what is going on here?  </p>