title: How to setup return value for a readonly property using RhinoMocks in VB.NET?
body: <p>I'm using RhinoMock in VB.NET and I need to set the return value for a readonly list.</p>
  
  <p>Here's what I <strong>want</strong> to do (but doesn't work):</p>
  
  <pre><code>dim s = Rhino.Mocks.MockRepository.GenerateStub(of IUserDto)()
  s.Id = guid.NewGuid
  s.Name = "Stubbed name"
  s.Posts = new List(of IPost)
  </code></pre>
  
  <p>It fails on the compile because Posts is a readonly property.</p>
  
  <p>Then I tried a lambda expression, which works fine for Function calls, but not so much for Properties.  This fails to compile.</p>
  
  <pre><code>s.Stub(Function(x As IUserDto) x.Posts).Return(New List(Of IPost))
  </code></pre>
  
  <p>Next (failing) attempt was to use SetupResults, but this failed stating that it cannot be used in Playback mode.</p>
  
  <pre><code>Rhino.Mocks.SetupResult.For(s.Posts).Return(New List(Of IPost))
  </code></pre>
  
  <p>Which brings me back to my question:</p>
  
  <p>How do I setup a return value for a readonly property using RhinoMocks in VB.NET?</p>