Skip to content
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

Add interfaces for classes with internal constructors as returned by IDynamoDBContext methods #632

Closed
mbp opened this issue Apr 27, 2017 · 3 comments
Labels
feature-request A feature should be added or improved.

Comments

@mbp
Copy link

mbp commented Apr 27, 2017

When working with Amazon.DynamoDBv2.DataModel, specifically IDynamoDBContext, it is useful to be able to mock the interface in a unit test.

However it is not possible to mock many of the types being returned by methods on the IDynamoDBContext interface.

Examples are Table and BatchGet.

As an example with NSubstitute

dynamoDbContext.GetTargetTable<MyModel>().ReturnsForAnyArgs(new Table());

However it is not possible to create an instance of Table because it has only internal constructors. For the same reason it is also not possible to mock the class.

@PavelSafronov PavelSafronov added the feature-request A feature should be added or improved. label Apr 27, 2017
@PavelSafronov
Copy link

Looks like this is related to #604, but concerns a slightly different set of files. This isn't on our roadmap right now, but I will add it to our feature requests backlog.
If you're interested in working on this addition, we're always happy to accept a pull request.

@PavelSafronov
Copy link

Request added to backlog. Closing.

@Kralizek
Copy link
Contributor

I just stumbled on this very issue. Is there a way to vote up a feature request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants