DapperLib / DapperLib/Dapper

How do I unit test Dapper?

Open
#1,074 26 comments 27 reactions 0 assignees View on GitHub

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:

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.