c# - How To Mock/Stub a Nhibernate QueryOver Call? -
how can stub call returns queryover object contains data?
public interface idata { iqueryable<customer> customersasqueryable { get; } iqueryover<customer> customersasqueryover { get; } } [fact] public void queryover_spike() { var customers = new list<customer> { new customer {name = "this"}, new customer {name = "is"}, new customer {name = "fubar"} }; var data = mockrepository.generatemock<idata>(); //this works data.stub(x => x.customersasqueryable).return(customers.asqueryable()); //how can stub this? data.stub(x => x.customersasqueryover).return(?????????); }
just phill said sqlite easier. nevertheless should work
var queryover = mockrepository.generatemock<iqueryover<customer>>(); queryover.stub(...).return(...); data.stub(x => x.customersasqueryover).return(queryover);
Comments
Post a Comment