feat(etl): add commandTimeoutSeconds to destinations
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user