Mocking ISession.Query<T>() for testing consumer
Posted
by
TheCloudlessSky
on Stack Overflow
See other posts from Stack Overflow
or by TheCloudlessSky
Published on 2011-01-14T20:43:35Z
Indexed on
2011/01/14
21:54 UTC
Read the original article
Hit count: 129
I'm trying to avoid using an in memory database for testing (though I might have to do this if the following is impossible). I'm using NHibernate 3.0 with LINQ. I'd like to be able to mock session.Query<T>()
to return some dummy values but I can't since it's an extension method and these are pretty much impossible to test.
Does anyone have any suggestions (other than using an in memory database) for testing session queries with LINQ?
© Stack Overflow or respective owner