69
// This test will throw an exception because Moq.Dapper doesn't support IDbConnection.ExecuteAsync(), even though it supports DbConnection.ExecuteAsync()
1
using System;
2
using Dapper;
3
using Moq;
4
using Moq.Dapper;
5
using System.Data;
6
using System.Data.Common;
7
using System.Linq;
8
9
public class Program
10
{
11
public class ComplexType
12
{
13
public string StringProperty { get; set; }
14
public int IntegerProperty { get; set; }
15
}
16
17
private static void TestMoqDapperExecuteAsyncDbConnection()
18
{
19
20
Console.WriteLine("Running ExecuteAsync<DbConnection> Test...");
21
22
var connection = new Mock<DbConnection>();
23
24
connection.SetupDapperAsync(c => c.ExecuteAsync("", null, null, null, null))
Cached Result