public void TestBatchSizeReset() { TableUploader tu = new TableUploader(); int batchSizeBefore = tu.GetBatchSize(); const String tableName = "IN_WMAIL"; tu.Process(VfpConnectionString, tableName, SqlConnectionString, tableName); int batchSizeAfter = tu.GetBatchSize(); Assert.IsTrue(batchSizeAfter > 0); Assert.IsTrue(batchSizeAfter != batchSizeBefore); }
public void TestEssexInWMailUpload() { VfpConnectionStringBuilder vfpConnStrBldr = new VfpConnectionStringBuilder(VfpConnectionString); vfpConnStrBldr.DataSource = @"D:\Essex\Hostdema\"; String vfpConnStr = vfpConnStrBldr.ConnectionString; String sqlConnStr = "Data Source = (local); Initial Catalog = Essex_22_000211; Integrated Security = True"; const String tableName = "IN_WMAIL"; Helper.ExecuteSqlNonQuery(sqlConnStr, "DELETE FROM " + tableName); string expectedRecordCountCmdStr = "SELECT COUNT(*) FROM " + tableName; int expectedRecordCount = Convert.ToInt32(Helper.GetOleDbScaler(vfpConnStr, expectedRecordCountCmdStr)); TableUploader tu = new TableUploader(); tu.Process(vfpConnStr, tableName, sqlConnStr, tableName); int actualRecordCount = Convert.ToInt32(Helper.GetSqlScaler(sqlConnStr, expectedRecordCountCmdStr)); Assert.AreEqual(expectedRecordCount, actualRecordCount); }