UnoSD / Moq.Dapper

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

Ability to mock Execute and ExecuteAsync. #13

Closed tombatron closed 6 years ago

tombatron commented 6 years ago

Hey there!

Some co-workers found your library and thought that it would be cool if it supported mocking Execute and ExecuteAsync.

So I thought I would take a stab at adding support for those two methods.

I'm not 100% satisfied with the result here as I don't seem to be able to control which result is returned based on the initial mock setup. Maybe you could point in the right direction?

Thanks!

Tom

julealgon commented 6 years ago

Do we have any updates here? We found this little library exactly because we were having a hard time mocking out ExecuteAsync from Dapper.

Finding out it was not supported in this project made me sad 😢

UnoSD commented 6 years ago

Hi @tombatron and @julealgon, I'm still planning to add the features and make this library support fully Dapper, but unfortunately I am really busy recently. I will probably have time to have a look in a couple of weeks as I am preparing to get a couple of MS certifications in the spare time now.

UnoSD commented 6 years ago

Hi @tombatron, can you please explain what you mean by I don't seem to be able to control which result is returned based on the initial mock setup?

Or even better, if you could write a unit test that fails, I can have a look and fix it to make it pass.

Thanks.

UnoSD commented 6 years ago

Going to merge for now (not updating NuGet) as I would like to refactor a bit, let me know which is the problematic scenario and I'll implement the fix after.