title: Invalid call, the last call has been used or no call has been made
body: <p>I am getting this error when I try to set a mock to have <code>PropertyBehavior()</code>:</p>
  
  <blockquote>
    <p>System.InvalidOperationException:  System.InvalidOperationException: 
        Invalid call, the last call has been used or no call has been made (make sure that you are calling a virtual (C#) / Overridable (VB) method).. </p>
  </blockquote>
  
  <p>I am trying to use only <a href="http://ayende.com/wiki/Rhino%20Mocks%203.5.ashx" rel="nofollow noreferrer">Rhino Mocks 3.5</a> (Arrange, Act, Assert)</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    private IAddAddressForm form;
  
      private AddAddressMediator mediator;
  
      [TestInitialize()]
      public void MyTestInitialize()
      {
          form = MockRepository.GenerateMock&lt;IAddAddressForm&gt;();
          mediator = new AddAddressMediator(form);
  
  
          // Make the properties work like a normal property
          Expect.Call(form.OKButtonEnabled).PropertyBehavior();
  
          //I tried this too.  I still get the exception
          //SetupResult.For(form.OKButtonEnabled).PropertyBehavior();
      }
  
  
      [TestMethod]
      public void TestOKButtonEnabled()
      {
  
          form.OKButtonEnabled = true;
          Assert.IsTrue(form.OKButtonEnabled);
      }
  </code></pre>
  
  <p>I know I could use a stub (and for the code above I should) but I am trying to learn Rhino Mocks.</p>
  
  <p>Eventually I want to be able to make sure that several properties has their values accessed.  (Any hints on how to check that <code>form.FirstName</code> was accessed (i.e. the getter was called) would also be appreciated.)</p>
  
  <p>In case it is needed, here is the code to <code>IAddressForm</code>:</p>
  
  <pre><code>namespace AddressBook
  {
      public interface IAddAddressForm
      {
          string FirstName { get; set; }
          string LastName { get; set; }
          string Address1 { get; set; }
          string State { get; set; }
          string Address2 { get; set; }
          string ZipCode { get; set; }
          string City { get; set; }
          bool OKButtonEnabled { get; set; }
      }
  }
  </code></pre>
  
  <p>Anyway, I thought that virtual would not be a problem as I am passing in an interface, but I am clearly missing something.</p>