-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should BatchWrite<T> implement an interface? #1565
Comments
We have noticed this issue has not recieved attention in a year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue. |
@ashishdhingra any comment on this? This is just one of many issues regarding the hard testability of code using DynamoDB. |
@Kralizek Some DynamoDB revamp work is planned in the coming sprints and this feature request might be included as well. We would post any updates here. |
This is one of the worst libraries regarding testability. Shame on you Amazon, shame 😡 |
I just ran into this as well. Can't test any data layer code at all because of this. |
I am also unable to run my tests due to this. |
+1 |
Any news on that? |
I just found the same problem :( |
Still waiting for the rework... |
+1, I worked around this by using the nullabilty operator when interacting with the BatchWrite object (ie I would also contend that the detail of BatchWrite should be ideally be hidden for the consumer and the dynamo context should expose something like |
Hello, we have been working on the V4 of the AWS SDK for .NET. We have added the ability to mock various DynamoDB operations by adding interfaces in both the Data Model mode and Document Model mode in DynamoDB. Refer to this PR - #3450 Specifically for the This feature is available in the AWSSDK.DynamoDBv2 Version 4.0.0-preview.2 |
Comments on closed issues are hard for our team to see. |
I'm trying to write a unit test to validate the BatchWrite.Execute invocation, but I'm struggling with the mock of the
CreateBatchWrite<T>
method because I'm not able to instantiate theBatchWrite<T>
class.I'm using Moq to build the mocks, the code looks like:
But the Returns part is throwing an error because the BatchWrite class does not have a default constructor.
Possible Solution
I think is a good idea to define an interface for the BatchWrite class. In this way, the unit test will be easier to write.
The text was updated successfully, but these errors were encountered: