Comments (7)
@UnoSD Thanks, I'm not sure when I'll get a chance to have a go but if I do come up with anything I'll leave a comment here.
from moq.dapper.
Quick update, I had some spare time at lunch today and I think I managed to mock QueryAsync
I'll clean it up and push it hopefully in the afternoon or just push a "to clean up" branch for you to have a look.
from moq.dapper.
Very cool! Thanks.
from moq.dapper.
Hi @tjrobinson, I just had a look and QueryAsync
is a bit trickier as it (surprise, surprise) expects the IDbCommand
to be a DbCommand
and does downcasting internally.
If you want to have a go, you will have to mock a DbCommand
instead of an IDbCommand
.
DbCommand
has, for instance, ExecuteDbDataReaderAsync
as a virtual method called by Dapper that you can easily mock to return the same reader from the sync version and wrap it into a Task
.
I won't have much time this weekend again otherwise I would have drafted an implementation myself. But I hope I will get to it at some point. Feel free to have a go and to ask me questions if you get stuck if you don't want to wait.
from moq.dapper.
I would also like to see this, but I was unable to get it working. Any updates / suggestions?
from moq.dapper.
Unfortunately I couldn't find some spare time to look into this, but I wrote already some hint from a brief investigation in my reply above. Feel free to ask me questions here and I will try and help when I can.
from moq.dapper.
OK, it needs some tidying up as it's mostly a copy and paste of the sync code, but it's there and I'm going to push it for you guys to have a look and play with. I hope I will have time to refactor it.
from moq.dapper.
Related Issues (20)
- moq.dapper 1.0.4 is a breaking change (only targets .Net Standard 2.1)
- When writing a test for query which has .Any method it throws an error Value cannot be null
- issue with DateTime in Core3.1 (works on 2.1)
- QuerySingleOrDefault cannot return null HOT 1
- QueryFirstAsync<string> doesn't work and throws sequence contains no elements error HOT 2
- Cannot moq 'Execute' after mocking 'QuerySingle<int>'
- How to Moq QueryMultipleAsync HOT 2
- ObjectExtensions - ToDataTable does not support string HOT 1
- QueryAsync<Dynamic> HOT 4
- Cannot mock ExecuteAsync for IDbConnection HOT 1
- Cannot QueryFirstAsync with Enum Type
- Can't query Tuples. Requires wrapping class type.
- One Approach to Moq dapper methods that not supported by this project
- No Support for ExecuteAsync on IDBConnection
- ExecuteScalarAsync not supported
- GPL2 licence issues HOT 3
- QueryAsync returns no records
- Moq with ReturnAsync for GUID is not working
- Testing Query with string array parameter
- Requesting support for Verify functions too
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moq.dapper.