title: How To Mock/Stub a Nhibernate QueryOver Call?
body: <p>How can I stub a call that returns a QueryOver object that contains data?</p>
  
  <pre><code>        public interface IData
          {
              IQueryable&lt;Customer&gt; CustomersAsQueryable { get; }
              IQueryOver&lt;Customer&gt; CustomersAsQueryOver { get; } 
          }
  
          [Fact]
          public void QueryOver_spike()
          {
              var customers = new List&lt;Customer&gt;
                                  {
                                      new Customer {Name = "this"},
                                      new Customer {Name = "is"},
                                      new Customer {Name = "fubar"}
                                  };         
  
              var data = MockRepository.GenerateMock&lt;IData&gt;();
  
              //this works
              data.Stub(x =&gt; x.CustomersAsQueryable).Return(customers.AsQueryable());
  
              //how can i stub this?
              data.Stub(x =&gt; x.CustomersAsQueryOver).Return(?????????);
          }
  </code></pre>