feat(etl): add commandTimeoutSeconds to destinations

This commit is contained in:
Joseph Doherty
2026-01-03 11:01:12 -05:00
parent 0e07a76438
commit 0b317c1ffc
4 changed files with 78 additions and 4 deletions
@@ -44,4 +44,32 @@ public class DbBulkImportDestinationTests
var dest = new DbBulkImportDestination(factory, "WorkOrder", batchSize: batchSize);
Assert.NotNull(dest);
}
[Fact]
public void Constructor_CustomTimeout_SetsTimeout()
{
// Arrange & Act
var factory = Substitute.For<IDbConnectionFactory>();
var dest = new DbBulkImportDestination(
factory,
"TestTable",
commandTimeoutSeconds: 1800);
// Assert - can't directly test private field, but constructor should accept it
Assert.NotNull(dest);
}
[Fact]
public void Constructor_ZeroTimeout_UsesDefault()
{
// Arrange & Act
var factory = Substitute.For<IDbConnectionFactory>();
var dest = new DbBulkImportDestination(
factory,
"TestTable",
commandTimeoutSeconds: 0);
// Assert
Assert.NotNull(dest);
}
}
@@ -62,4 +62,34 @@ public class DbBulkMergeDestinationTests
updateColumns: new[] { "Status", "Description" });
Assert.Equal("BulkMerge:WorkOrder", dest.DestinationName);
}
[Fact]
public void Constructor_CustomTimeout_SetsTimeout()
{
// Arrange & Act
var factory = Substitute.For<IDbConnectionFactory>();
var dest = new DbBulkMergeDestination(
factory,
"TestTable",
new[] { "Id" },
commandTimeoutSeconds: 1800);
// Assert - can't directly test private field, but constructor should accept it
Assert.NotNull(dest);
}
[Fact]
public void Constructor_ZeroTimeout_UsesDefault()
{
// Arrange & Act
var factory = Substitute.For<IDbConnectionFactory>();
var dest = new DbBulkMergeDestination(
factory,
"TestTable",
new[] { "Id" },
commandTimeoutSeconds: 0);
// Assert
Assert.NotNull(dest);
}
}