UnoSD / Moq.Dapper

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

Can't query Tuples. Requires wrapping class type. #82

Open 80O opened 1 year ago

80O commented 1 year ago

Using connection.QueryAsync<(string, uint)>("SELECT name, id FROM users") will not yield any results when being mocked.

The only way to mock this is to wrap the tuple in a class eg:

class UserInfo
{
public string Name {get; set;}
public uint Id {get; set;}
}

`connection.QueryAsync<UserInfo>("SELECT name, id FROM users")`

Thought this library was not working or misconfigured at first before I tried this.