public void BulkCopyProviderSpecific([IncludeDataSources(TestProvNameDb2i.All_AccessClient, TestProvNameDb2i.All_DB2Connect)] string context) { if (TestProvNameDb2i.IsiSeriesAccessClient(context)) { BulkCopyTest_DB2Connect(context, BulkCopyType.ProviderSpecific, 50000, 100001); } if (TestProvNameDb2i.IsiSeriesDB2Connect(context)) { BulkCopyTest_AccessClient(context, BulkCopyType.ProviderSpecific, 50000, 100001); } }
public void SchemaProvider([IncludeDataSources(TestProvNameDb2i.All_73)] string context) { using (var conn = new DataConnection(context)) { var sp = conn.DataProvider.GetSchemaProvider(); var dbSchema = sp.GetSchema(conn); var table = dbSchema.Tables.Single(t => t.IsDefaultSchema && t.TableName == "ALLTYPES"); if (TestProvNameDb2i.IsiSeries(context)) { var binaryType = TestProvNameDb2i.IsiSeriesAccessClient(context) ? "BINARY(20)" : "BINARY"; Assert.That(table.Columns.Single(c => c.ColumnName == "BINARYDATATYPE").ColumnType, Is.EqualTo(binaryType)); Assert.That(table.Columns.Single(c => c.ColumnName == "VARBINARYDATATYPE").ColumnType, Is.EqualTo("VARBIN")); } else { Assert.That(table.Columns.Single(c => c.ColumnName == "BINARYDATATYPE").ColumnType, Is.EqualTo("CHAR (5) FOR BIT DATA")); Assert.That(table.Columns.Single(c => c.ColumnName == "VARBINARYDATATYPE").ColumnType, Is.EqualTo("VARCHAR (5) FOR BIT DATA")); } } }
public void TestDate([IncludeDataSources(TestProvNameDb2i.All)] string context) { using (var conn = new DataConnection(context)) { var dateTime = new DateTime(2012, 12, 12); Assert.That( conn.ExecuteScalar <DateTime>("'2012-12-12'", "date"), Is.EqualTo(dateTime)); Assert.That( conn.ExecuteScalar <DateTime?>("'2012-12-12'", "date"), Is.EqualTo(dateTime)); Assert.That( conn.ExecuteScalarParameter <DateTime>(DataParameter.Date("p", dateTime), "date"), Is.EqualTo(dateTime)); Assert.That( conn.ExecuteScalarParameter <DateTime>("p", "date", dateTime, DataType.Date), Is.EqualTo(dateTime)); //iSeries native provider cannot assign datetime parameter to date if (!TestProvNameDb2i.IsiSeriesAccessClient(context)) { Assert.That( conn.ExecuteScalarParameter <DateTime>("p", "date", dateTime), Is.EqualTo(dateTime)); } } }