You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using LINQ extensions MaxAsync and CountAsync in my code. Is there a way for me to Unit test it?
I see comments here and here which say it is very difficult to mock extensions. If you can help with any other way of doing it, it will be really helpful.
Thanks!
The text was updated successfully, but these errors were encountered:
The easiest solution is create a wrapper as explained in this issue you already have linked.
The other solution is mocking Container.GetItemLinqQueryable and return a List . When you call CountAsync it will just call the List.Count method. The downside to this is it won't support any of the inner linq extensions like IsDefined.
I am using LINQ extensions MaxAsync and CountAsync in my code. Is there a way for me to Unit test it?
I see comments here and here which say it is very difficult to mock extensions. If you can help with any other way of doing it, it will be really helpful.
Thanks!
The text was updated successfully, but these errors were encountered: