Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source
In directory sc8-pr-cvs1:/tmp/cvs-serv30441
Modified Files:
PgCommandBuilderTest.cs
Log Message:
Added a new test case for PgCommandBuilder
Index: PgCommandBuilderTest.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgCommandBuilderTest.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PgCommandBuilderTest.cs 15 Aug 2003 17:51:20 -0000 1.2
--- PgCommandBuilderTest.cs 22 Aug 2003 19:40:36 -0000 1.3
***************
*** 146,149 ****
--- 146,181 ----
}
}
+
+ [Test]
+ public void TestWithClosedConnection()
+ {
+ Connection.Close();
+
+ PgCommand command = new PgCommand("select * from public.test_table where int4_field = @int4_field and varchar_field = @varchar_field", Connection);
+ PgDataAdapter adapter = new PgDataAdapter(command);
+ PgCommandBuilder builder = new PgCommandBuilder(adapter);
+
+ Console.WriteLine();
+ Console.WriteLine("\r\nPgCommandBuilder - RefreshSchema Method Test - Commands for original SQL statement: ");
+
+ Console.WriteLine(builder.GetInsertCommand().CommandText);
+ Console.WriteLine(builder.GetUpdateCommand().CommandText);
+ Console.WriteLine(builder.GetDeleteCommand().CommandText);
+
+ adapter.SelectCommand.CommandText = "select int4_field, date_field from public.test_table where int4_field = @int4_field";
+
+ builder.RefreshSchema();
+
+ Console.WriteLine();
+ Console.WriteLine("\r\nPgCommandBuilder - RefreshSchema Method Test - Commands for new SQL statement: ");
+
+ Console.WriteLine(builder.GetInsertCommand().CommandText);
+ Console.WriteLine(builder.GetUpdateCommand().CommandText);
+ Console.WriteLine(builder.GetDeleteCommand().CommandText);
+
+ builder.Dispose();
+ adapter.Dispose();
+ command.Dispose();
+ }
}
}
|