From 408dc906322c21f0499c9309e7ab528c11200f3b Mon Sep 17 00:00:00 2001 From: Juan Martinez Ramirez Date: Mon, 7 Oct 2024 10:08:06 -0600 Subject: [PATCH] Apply PR suggestions --- .../SFDbDataReaderGetEnumeratorIT.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderGetEnumeratorIT.cs b/Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderGetEnumeratorIT.cs index 82deac5b3..88e25256e 100755 --- a/Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderGetEnumeratorIT.cs +++ b/Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderGetEnumeratorIT.cs @@ -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(); @@ -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(); @@ -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(); @@ -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(); @@ -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(); @@ -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(); @@ -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(); }