How do I unit test Dapper?
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 3.7k
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
The Dapper readme has no info on unit testing, and suprisingly there is not much tutorials online either.
The two main unit test libraries I was able to find were:
- DapperWrapper (not updated since 2014!!! Does it still work?)
- Moq.Dapper (requires .net core v2, but many people are still on VS2015+.net 4.6.2 or lesser)
When I google "unit test dapper" my top three results are:
- https://mikhail.io/2016/02/unit-testing-dapper-repositories <- requires in-memory db
- this stackoverflow <- also requires in-memory db
- https://www.intertech.com/Blog/unit-test-dapper-with-dapperparameters/ <- 2015 article promoting a library with only three stars
The dapper repo, meanwhile, appears to have integration tests using a actual database. While having a database for integration tests is ideal, it should also be possible to mock the connection so a database is not required.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the README and the repository's existing integration tests, which the issue identifies as using an actual database. Determine whether the project has a supported unit-testing approach for mocked connections, then document the guidance and its limitations in the README.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- databases, testing-qa
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100