[pgsqlclient-checkins] pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source PGCommandTest.cs,1.4
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2003-07-19 10:12:32
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source In directory sc8-pr-cvs1:/tmp/cvs-serv30246 Modified Files: PGCommandTest.cs Log Message: Prepare for Alpha 1 release. Index: PGCommandTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient.UnitTests/source/PGCommandTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PGCommandTest.cs 15 Jul 2003 19:11:39 -0000 1.4 --- PGCommandTest.cs 19 Jul 2003 10:12:29 -0000 1.5 *************** *** 158,179 **** public void RecordsAffectedTest() { PGCommand selectCommand = new PGCommand("SELECT * FROM public.test_table WHERE int_field = 100", Connection); int recordsAffected = selectCommand.ExecuteNonQuery(); Console.WriteLine("\r\nRecords Affected by SELECT command: {0}", recordsAffected); - if (recordsAffected != -1) - { - throw new EvaluateException("Invalid RecordsAffected value for SELECT command"); - } selectCommand.Dispose(); PGCommand deleteCommand = new PGCommand("DELETE FROM public.test_table WHERE int_field = 45", Connection); recordsAffected = deleteCommand.ExecuteNonQuery(); ! Console.WriteLine("\r\nRecords Affected by DELETE command: {0}", recordsAffected); ! if (recordsAffected != 1) ! { ! throw new EvaluateException("Invalid RecordsAffected value for DELETE command"); ! } ! // Assertion.Assert(recordsAffected == 1); deleteCommand.Dispose(); } } --- 158,176 ---- public void RecordsAffectedTest() { + // Execute a SELECT command PGCommand selectCommand = new PGCommand("SELECT * FROM public.test_table WHERE int_field = 100", Connection); int recordsAffected = selectCommand.ExecuteNonQuery(); Console.WriteLine("\r\nRecords Affected by SELECT command: {0}", recordsAffected); selectCommand.Dispose(); + + Assertion.Assert(recordsAffected == -1); + // Execute a DELETE command PGCommand deleteCommand = new PGCommand("DELETE FROM public.test_table WHERE int_field = 45", Connection); recordsAffected = deleteCommand.ExecuteNonQuery(); ! Console.WriteLine("\r\nRecords Affected by DELETE command: {0}", recordsAffected); deleteCommand.Dispose(); + + Assertion.Assert(recordsAffected == 1); } } |