public void TestAutoClose() { ConnectionStateCase.ForEach(c => { var input = new InOutParameters { In = 5 }; var result = c.InsertSqlAsync("SELECT @In", input).Result; }); }
public void TestOutputParameters() { var input = new InOutParameters { In = 5 }; var output = new OutParameters(); var result = Connection().InsertAsync(InOutParameters.ProcName, input, outputParameters: output).Result; input.Verify(output); }
public void TestOutputParameters() { var input = new InOutParameters { In = 5 }; var output = new OutParameters(); Connection().ExecuteAsync(InOutParameters.ProcName, input, outputParameters: output).Wait(); input.Verify(output); }
public void TestOutputParameters() { var input = new InOutParameters { In = 5 }; var output = new OutParameters(); Connection().Query<Beer>(InOutParameters.ProcName, input, outputParameters: output); input.Verify(output); }
public void TestOutputParameters() { var input = new InOutParameters { In = 5 }; var output = new OutParameters(); var result = Connection().ExecuteScalar<int>(InOutParameters.ProcName, input, outputParameters: output); Assert.AreEqual(input.In, result); input.Verify(output); }
public void TestOutputParametersInList() { var list = new List<int>(); var input = new InOutParameters { In = 5 }; var output = new OutParameters(); var result = Connection().InsertList(InOutParameters.ProcName, list, input, outputParameters: output); input.Verify(output); }
public void TestOutputParameters() { var input = new InOutParameters { In = 5 }; var output = new OutParameters(); // notice here how we don't actually read the recordset, but the framework goes all the way to the end for us Connection().QueryAsync(InOutParameters.ProcName, input, reader => 1, outputParameters: output).Wait(); input.Verify(output); }
public void TestForceClose() { ConnectionStateCase.ForEach(c => { bool wasOpen = c.State == ConnectionState.Open; var input = new InOutParameters { In = 5 }; var recordCount = c.InsertSqlAsync("SELECT @In", input, commandBehavior: CommandBehavior.CloseConnection).Result; Assert.AreEqual(ConnectionState.Closed, c.State); if (wasOpen) c.Open(); }); }