Skip to content

Ability to mock generic TransactWrite<T> #2630

Closed
@roelvandenbrand

Description

@roelvandenbrand

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

  • I may be able to implement this feature request

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    dynamodbfeature-requestA feature should be added or improved.needs-major-versionCan only be considered for the next major releasep1This is a high priority issuequeuedv4

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions