Skip to content

Commit

Permalink
[DB-20271] Update EF tests to allow different return types
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Massari committed Nov 7, 2017
1 parent 973a52a commit 9d0a7f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion NUnitEFCodeFirstTestProject/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class Utils
static string schema = "hockey";
static internal string connectionString = "Server= " + host + "; Database=\"" + database + "\"; User = " + user + " ;Password = '" + password + "';Schema=\"" + schema + "\"";

internal static int ToInt(object value)
{
// go through a parse step to accomodate both 32 and 64 bit return values
return Int32.Parse(value.ToString());
}

internal static void DropTable(NuoDbConnection cnn, string tableName)
{
try
Expand Down Expand Up @@ -250,7 +256,7 @@ internal static int GetTableRows()
DbCommand command = new NuoDbCommand("select count(*) from hockey", connection);

connection.Open();
return (int)command.ExecuteScalar();
return Utils.ToInt(command.ExecuteScalar());
}
}
}
Expand Down

0 comments on commit 9d0a7f1

Please sign in to comment.