Skip to content

Commit

Permalink
2004-07-28 Umadevi S <sumadevi@novell.com>
Browse files Browse the repository at this point in the history
        * OdbcCommandTest.cs - Added testcase for bug 61968. String values passed with quotes

svn path=/branches/mono-1-0/mcs/; revision=31533
  • Loading branch information
Umadevi S committed Jul 28, 2004
1 parent 576c9bb commit 3f20b93
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mcs/class/System.Data/Test/System.Data.Odbc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2004-07-28 Umadevi S <sumadevi@novell.com>
* OdbcCommandTest.cs - Added testcase for bug 61968. String values passed with quotes

2004-07-01 Sureshkumar T <tsureshkumar@novell.com>
* Added test case for OdbcCommand.ExecuteScalar Method
* New files:
Expand Down
20 changes: 20 additions & 0 deletions mcs/class/System.Data/Test/System.Data.Odbc/OdbcCommandTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,25 @@ public void ExecuteScalarTest ()
object objCount = cmd.ExecuteScalar ();
Assertion.AssertEquals( "ExecuteScalar does not return int type", 5, Convert.ToInt32(objCount));
}

/// <summary>
/// Test String parameters to ODBC Command
/// </summary>
[Test]
public void ExecuteStringParameterTest()
{

OdbcCommand dbcmd = new OdbcCommand();
dbcmd.Connection = conn;
dbcmd.CommandType = CommandType.Text;
dbcmd.CommandText = "select count(*) from test where col_char=?;";
string colvalue = "mono test";
dbcmd.Parameters.Add("@un",colvalue);
Object obj = dbcmd.ExecuteScalar();
Assertion.AssertEquals( "String parameter not passed correctly",5, Convert.ToInt32(obj));


}

}
}

0 comments on commit 3f20b93

Please sign in to comment.