UnoSD / Moq.Dapper

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

Add support for null values and strings to First/SingleOrDefault returns #79

Closed tvanfosson-il closed 1 year ago

tvanfosson-il commented 2 years ago

This pull request adds support for:

It does this by modifying the ObjectExtensions to use a switch statement that provides matches for null values and strings before the existing behaviors. Null values use an empty array to convert to the DataTable, while strings use the existing behavior for non-IEnumerables. Since this check needs to happen before the test for the result being IEnumerable, there's a slight duplication that has been documented.

tvanfosson-il commented 1 year ago

Ping. Any idea on when you'll act on this?

UnoSD commented 1 year ago

@tvanfosson-il thank you for the PR, sorry it took so long, I will merge it now