[pgsqlclient-checkins] pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source PGBaseTest.cs,1.8,1.
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2003-07-28 18:26:44
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source In directory sc8-pr-cvs1:/tmp/cvs-serv29202 Modified Files: PGBaseTest.cs PGCommandTest.cs Log Message: Added new NUnit test for function calls (Stored procedure calls). Index: PGBaseTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source/PGBaseTest.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PGBaseTest.cs 26 Jul 2003 12:48:22 -0000 1.8 --- PGBaseTest.cs 28 Jul 2003 18:26:41 -0000 1.9 *************** *** 58,61 **** --- 58,62 ---- createTables(); + createFunctions(); } *************** *** 154,157 **** --- 155,174 ---- insertTestData(); + } + + private void createFunctions() + { + StringBuilder commandText = new StringBuilder(); + + commandText.Append("CREATE OR REPLACE FUNCTION public.TestCount()"); + commandText.Append("RETURNS int8 AS"); + commandText.Append("'"); + commandText.Append("select count(*) from test_table;"); + commandText.Append("'"); + commandText.Append("LANGUAGE 'sql' VOLATILE;"); + + PGCommand command = new PGCommand(commandText.ToString(), connection); + command.ExecuteNonQuery(); + command.Dispose(); } Index: PGCommandTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source/PGCommandTest.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PGCommandTest.cs 26 Jul 2003 12:30:31 -0000 1.7 --- PGCommandTest.cs 28 Jul 2003 18:26:41 -0000 1.8 *************** *** 150,156 **** [Test] - [Ignore("Not implemented.")] public void ExecuteStoredProcTest() ! { } --- 150,165 ---- [Test] public void ExecuteStoredProcTest() ! { ! PGCommand command = new PGCommand("TestCount()", Connection); ! command.CommandType = CommandType.StoredProcedure; ! ! command.Parameters.Add("@CountResult", PGDbType.Int8).Direction = ParameterDirection.Output; ! ! command.ExecuteNonQuery(); ! ! Console.WriteLine("ExecuteStoredProcTest - Count result {0}", command.Parameters[0].Value); ! ! command.Dispose(); } |