* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System.Data / Test / ProviderTests / ProviderIndependant / DataReaderTest.cs
index a5b60dad3686bd2aaddbe23493b8803f7f863373..9ae60988067247df9a36c13887bb67f48282b95b 100644 (file)
@@ -226,5 +226,26 @@ namespace MonoTests.System.Data
                                ConnectionManager.Singleton.CloseConnection ();
                        }
                }
+
+               [Test]
+               public void GetSchemaTableTest_AutoIncrement ()
+               {
+                       IDbConnection conn = ConnectionManager.Singleton.Connection;
+                       try {
+                               ConnectionManager.Singleton.OpenConnection ();
+                               IDbCommand cmd = conn.CreateCommand ();
+                               cmd.CommandText = "create table #tmp_table (id int identity(1,1))";
+                               cmd.ExecuteNonQuery ();
+                               cmd.CommandText = "select * from #tmp_table";
+                               using (IDataReader reader = cmd.ExecuteReader (CommandBehavior.SchemaOnly)) {
+                                       DataTable schemaTable = reader.GetSchemaTable ();
+                                       Assert.IsTrue ((bool)schemaTable.Rows [0]["IsAutoIncrement"], "#1");
+                                       if (schemaTable.Columns.Contains ("IsIdentity"))
+                                               Assert.IsTrue ((bool)schemaTable.Rows [0]["IsIdentity"], "#2");
+                               }
+                       } finally {
+                               ConnectionManager.Singleton.CloseConnection ();
+                       }
+               }
        }
 }