UnoSD / Moq.Dapper

Moq extensions for Dapper methods.
GNU General Public License v2.0
173 stars 78 forks source link

Add support for Single, SingleOrDefault, First and FirstOrDefault #53

Closed oppewala closed 3 years ago

oppewala commented 4 years ago

I've added a support for the Single, SingleOrDefault, First and FirstOrDefault queries.

I haven't been able to get 'ThrowsException' working, as the way the DbCommandSetup stuff works means that it throws the exception when the SetupCommand method is called, not when the mock is actually invoked.

oppewala commented 4 years ago

I've updated the code to reflect the preferred indentation style (and updated the resharper config to do it automatically).

The GetAwaiter().GetResult() should potentially be a separate pull request, since it's not related to adding Single/SingleOrDefault/First/FirstOrDefault.

UnoSD commented 4 years ago

Thank you for that. I will probably have some time only in January to look at it, but I will do my best to do it sooner. Can you please remove refactoring that is not related to the change?

oppewala commented 4 years ago

Hi @UnoSD, I've undone what I think you meant by unrelated refactoring. Let me know if you think I've missed something.

jerone commented 4 years ago

@UnoSD Can this be merged? We need these methods in our tests.

electroholic commented 4 years ago

@UnoSD Hi - can I second the vote to get this merged into master and published on nuget please?

imad-mn commented 3 years ago

Hello @UnoSD , can you please merge this into master and get it published? I believe many people is waiting for this change.

Lonli-Lokli commented 3 years ago

@imad-mn you can try my fork, https://www.nuget.org/packages/Dapper.Moq/