Ability to mock generic TransactWrite<T> #2630
Labels
dynamodb
feature-request
A feature should be added or improved.
needs-major-version
Can only be considered for the next major release
p1
This is a high priority issue
queued
v4
Describe the feature
With a IAmazonDynamoDB or IDynamoDBContext I would like to be able to return TransactWrite. There does not seem to be a public constructor or interface which would be very handy.
Use Case
Mocking Transactions. First building the TransactWriteItems with AddSaveItem and such. And at last do a mocked ExecuteAsync call.
Proposed Solution
Make a public constructor for TransactWrite or an interface to be able to mock it directly.
Other Information
I also tried the DbContext.CreateTransactWrite with a mocked DescribeTablesAsync, but internally DescribeTables is used. Which is not in the interface. So I could not create a TransactWrite that way either.
Acknowledgements
AWS .NET SDK and/or Package version used
AWSSDK.DynamoDBv2 3.7.103.20
Targeted .NET Platform
.NET 6
Operating System and version
Windows 11, AmazonLinux
The text was updated successfully, but these errors were encountered: