How could I Mock the FromSql() method?
问题 I was wondering is there any way other than building a wrapper for mocking the FromSql ? I know this method is static, but since they added things like AddEntityFrameworkInMemoryDatabase to entity framework core, I thought there might be a solution for this too, I use EF Core 1.0.1 in my project. My end goal is to test this method: public List<Models.ClosestLocation> Handle(ClosestLocationsQuery message) { return _context.ClosestLocations.FromSql( "EXEC GetClosestLocations {0}, {1}, {2}, {3}"