Skip to content

Commit

Permalink
Apply PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jmartinezramirez committed Oct 8, 2024
1 parent 3b11115 commit 408dc90
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void TestGetEnumerator()
{
using (var conn = CreateAndOpenConnection())
{
CreateAndPopulateTestTable(conn, out var cmd);
CreateAndPopulateTestTable(conn);

string selectCommandText = $"select * from {TableName}";
IDbCommand selectCmd = conn.CreateCommand();
Expand All @@ -42,11 +42,11 @@ public void TestGetEnumerator()

var enumerator = reader.GetEnumerator();
Assert.IsTrue(enumerator.MoveNext());
Assert.AreEqual(1, (enumerator.Current as DbDataRecord).GetInt64(0));
Assert.AreEqual(3, (enumerator.Current as DbDataRecord).GetInt64(0));
Assert.IsTrue(enumerator.MoveNext());
Assert.AreEqual(2, (enumerator.Current as DbDataRecord).GetInt64(0));
Assert.AreEqual(5, (enumerator.Current as DbDataRecord).GetInt64(0));
Assert.IsTrue(enumerator.MoveNext());
Assert.AreEqual(3, (enumerator.Current as DbDataRecord).GetInt64(0));
Assert.AreEqual(8, (enumerator.Current as DbDataRecord).GetInt64(0));
Assert.IsFalse(enumerator.MoveNext());

reader.Close();
Expand All @@ -60,7 +60,7 @@ public void TestGetEnumeratorShouldBeEmptyWhenNotRowsReturned()
{
using (var conn = CreateAndOpenConnection())
{
CreateAndPopulateTestTable(conn, out var cmd);
CreateAndPopulateTestTable(conn);

string selectCommandText = $"select * from {TableName} WHERE cola > 10";
IDbCommand selectCmd = conn.CreateCommand();
Expand All @@ -81,7 +81,7 @@ public void TestGetEnumeratorWithCastMethod()
{
using (var conn = CreateAndOpenConnection())
{
CreateAndPopulateTestTable(conn, out var cmd);
CreateAndPopulateTestTable(conn);

string selectCommandText = $"select * from {TableName}";
IDbCommand selectCmd = conn.CreateCommand();
Expand All @@ -102,7 +102,7 @@ public void TestGetEnumeratorForEachShouldNotEnterWhenResultsIsEmpty()
{
using (var conn = CreateAndOpenConnection())
{
CreateAndPopulateTestTable(conn, out var cmd);
CreateAndPopulateTestTable(conn);

string selectCommandText = $"select * from {TableName} WHERE cola > 10";
IDbCommand selectCmd = conn.CreateCommand();
Expand All @@ -124,7 +124,7 @@ public void TestGetEnumeratorShouldThrowNonSupportedExceptionWhenReset()
{
using (var conn = CreateAndOpenConnection())
{
CreateAndPopulateTestTable(conn, out var cmd);
CreateAndPopulateTestTable(conn);

string selectCommandText = $"select * from {TableName}";
IDbCommand selectCmd = conn.CreateCommand();
Expand Down Expand Up @@ -152,13 +152,13 @@ private void DropTestTableAndCloseConnection(DbConnection conn)
CloseConnection(conn);
}

private void CreateAndPopulateTestTable(DbConnection conn, out IDbCommand cmd)
private void CreateAndPopulateTestTable(DbConnection conn)
{
CreateOrReplaceTable(conn, TableName, new []{"cola NUMBER"});

cmd = conn.CreateCommand();
var cmd = conn.CreateCommand();

string insertCommand = $"insert into {TableName} values (1),(2),(3)";
string insertCommand = $"insert into {TableName} values (3),(5),(8)";
cmd.CommandText = insertCommand;
cmd.ExecuteNonQuery();
}
Expand Down

0 comments on commit 408dc90

Please sign in to comment.