I’m writing a unit test of a class. Several of the class’s methods take IQueryable objects as parameters, and I want to mock the objects that are passed into those methods. Are there any collections built into C# that implement IQueryable? If not, how can I mock these objects?
I’m writing a unit test of a class. Several of the class’s methods take
Share
Just use
IEnumerable<T>.AsQueryable(). Use whateverIEnumerable<T>implementer you like.