I am using EF Core non-entity model with get stored procedure calling. See below sample code
context.Query<ClassDTO>().FromSql("SpName @Param1, @Param2, @Param3",
new SqlParameter[] { param1, param2, param3 }).ToList();
Code is working fine. But I need to write mock test cases.
Can anyone help me out? How to mock Context.Query
or how to write test cases for this code?
I tried to implement the follow way:
https://nodogmablog.bryanhogan.net/2017/11/unit-testing-entity-framework-core-stored-procedures/
But it will work for ** productContext.Products.MockFromSql(...)
But for me It is Like productContext.Query.MockFromSql(). So advice me how to write test cases.
Thanks in advance.
A Siva