public void DbOverrideSimpleBatchTest(int concurrencyCount) { string tmpFile = string.Empty; MultiDbData multiData; try { (tmpFile, multiData) = GetMultiDbData(); var flattened = Concurrency.FlattenOverride(multiData); int totalRowCount = flattened.Count(); double expectedChunks = Math.Ceiling((double)totalRowCount / (double)concurrencyCount); int lastBatchSize = totalRowCount; var output = Concurrency.ConcurrencyByInt(multiData, concurrencyCount); Assert.IsTrue(expectedChunks <= output[0].Count() && output[0].Count() >= expectedChunks - 1); Assert.AreEqual(concurrencyCount, output.Count()); // Assert.AreEqual(lastBatchSize, output.Last().Count()); } finally { if (File.Exists(tmpFile)) { File.Delete(tmpFile); } } }
public void DbOverrideFlattenTest() { string tmpFile = string.Empty; MultiDbData multiData; try { (tmpFile, multiData) = GetMultiDbData(); var flattened = Concurrency.FlattenOverride(multiData); Assert.AreEqual(2366, flattened.Count); } finally { if (File.Exists(tmpFile)) { File.Delete(tmpFile); } } }