Skip to content

Commit

Permalink
Make the test compatible with different types of numeric result
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Massari committed May 5, 2016
1 parent a5d3801 commit 27f2220
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions NUnitTestProject/TestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public void TestInsertWithGeneratedKeys()

DbCommand maxIdCmd = connection.CreateCommand();
maxIdCmd.CommandText = "select max(id) from hockey";
long maxId = (long)maxIdCmd.ExecuteScalar();
long maxId = ((IConvertible)maxIdCmd.ExecuteScalar()).ToInt64(null);

DbCommand updateCommand = connection.CreateCommand();
updateCommand.CommandText = "insert into hockey (number, name) values (99, 'xxxx')";
Expand Down Expand Up @@ -443,7 +443,7 @@ public void TestPreparedInsertWithGeneratedKeys1()

DbCommand maxIdCmd = connection.CreateCommand();
maxIdCmd.CommandText = "select max(id) from hockey";
long maxId = (long)maxIdCmd.ExecuteScalar();
long maxId = ((IConvertible)maxIdCmd.ExecuteScalar()).ToInt64(null);

DbCommand updateCommand = connection.CreateCommand();
updateCommand.CommandText = "insert into hockey (number, name) values (?, ?)";
Expand Down Expand Up @@ -476,7 +476,7 @@ public void TestPreparedInsertWithGeneratedKeys2()

DbCommand maxIdCmd = connection.CreateCommand();
maxIdCmd.CommandText = "select max(id) from hockey";
long maxId = (long)maxIdCmd.ExecuteScalar();
long maxId = ((IConvertible)maxIdCmd.ExecuteScalar()).ToInt64(null);

DbCommand updateCommand = connection.CreateCommand();
updateCommand.CommandText = "insert into hockey (number, name) values (?, ?)";
Expand Down

0 comments on commit 27f2220

Please sign in to comment.