Code Monkey home page Code Monkey logo

Comments (7)

tjrobinson avatar tjrobinson commented on May 28, 2024 1

@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.

UnoSD avatar UnoSD commented on May 28, 2024 1

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.

rolingjp avatar rolingjp commented on May 28, 2024 1

Very cool! Thanks.

from moq.dapper.

UnoSD avatar UnoSD commented on May 28, 2024

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.

rolingjp avatar rolingjp commented on May 28, 2024

I would also like to see this, but I was unable to get it working. Any updates / suggestions?

from moq.dapper.

UnoSD avatar UnoSD commented on May 28, 2024

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.

UnoSD avatar UnoSD commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.