public async Task Can_execute_scalar_command() { using (var testDatabase = await SqlServerTestDatabase.Default()) { var commandExecutor = new SqlServerSimpleCommandExecutor(testDatabase.Connection.ConnectionString); var scalar = await commandExecutor.ExecuteScalarAsync <int>("select 42", CancellationToken.None); Assert.Equal(42, scalar); } }
public async Task Can_execute_scalar_command() { using (var testDatabase = await SqlServerTestDatabase.Default()) { var commandExecutor = new SqlServerSimpleCommandExecutor(testDatabase.Connection.ConnectionString); var scalar = await commandExecutor.ExecuteScalarAsync<int>("select 42", CancellationToken.None); Assert.Equal(42, scalar); } }