title: mock object that implements gets and sets not defined in interface
body: <p>Using Moq, RhinoMocks or a similar framework, is there a way to configure a mock to implement both get and set on all properties of an object even if the interface does not?  </p>
  
  <p>I can certainly mock the objects manually, but would prefer to use an isolation framework like Moq or RhinoMocks to avoid creating a bunch of boilerplate classes.</p>
  
  <p>Here's some sample code:</p>
  
  <pre><code>//interface to be mocked
  public interface IMyObject
  {
      string Property1 { set; }
  }
  
  //test method code
  var mock = Moq.Mock&lt;IMyObject&gt;();
  
  //...some code here to configure all properties on mock to have a get and set...
  
  var mockObject = mock.Object;
  
  ClassUnderTest obj = new ClassUnderTest(mockObject);
  obj.MethodUnderTest();
  
  Assert.IsTrue(!String.IsNullOrEmpty(mockObject.Property1));    
  </code></pre>
  
  <p>Running the code as is will throw an exception on mockObject.Property1 because the IMyObject.Property1 property lacks the get accessor.</p>
  
  <p>Thanks, DanO</p>