title: Mocking Factory with arguments
body: <p>I'm learning Rhino Mocks</p>
  
  <p>And don't know how to mock factory:
  I have a IViewModelFactory interface which is used by IOC </p>
  
  <pre><code>public interface IViewModelFactory
  {
    T Create&lt;T&gt;() where T : IViewModel;
    T Create&lt;T&gt;(int Id) where T : IViewModel;
  }
  </code></pre>
  
  <p>Currently I create mock with:</p>
  
  <pre><code>var _viewModelFactory = MockRepository.GenerateStub&lt;IViewModelFactory&gt;();
     viewModelFactory.Stub(x =&gt; x.Create&lt;ViewModel1&gt;())
                         .Return(new ViewModel1());
  </code></pre>
  
  <p>The ViewModel1 is a class like:</p>
  
  <pre><code>public class ViewModel1:BaseViewModel,IViewModel
  {
    private int _id;
    public int ID
    {
      get { return _id;}
      set {
        if (_id==value) return;
        _id= value;
        RaisePropertyChanged(()=&gt;ID)
      }
    }
  
    public ViewModel1()
    {
      ID=0;
    }
  
    public ViewModel1(int id)
    {
      ID=id;
    }
  }
  </code></pre>
  
  <p>And this works for </p>
  
  <pre><code>  _viewModelFactory.Get&lt;ViewModel1&gt;();
  </code></pre>
  
  <p>But don't know how to create Stub for like:</p>
  
  <pre><code>  _viewModelFactory.Get&lt;ViewModel1&gt;(25);
  </code></pre>
  
  <p>Is that possible to mock?</p>