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

Allow setters on DTOs or implement an interface for unit testing #681

Open
rcollette opened this issue Oct 27, 2023 · 1 comment
Open

Allow setters on DTOs or implement an interface for unit testing #681

rcollette opened this issue Oct 27, 2023 · 1 comment

Comments

@rcollette
Copy link

rcollette commented Oct 27, 2023

Describe the feature request?

Classes such as ActivationToken do not have public property setters and therefore cannot be constructed in in unit tests with expected responses. They also cannot be mocked using Moq because they do not implement an interface.

Another example, in a unit test, a user is created and subsequently activated. Activation requires a user id, but the user id cannot be set on the User object, so I cannot unit test my process.

New or Affected Resource(s)

ActivationToken and User at least but there are others.

Provide a documentation link

No response

Additional Information?

No response

@laura-rodriguez
Copy link
Collaborator

Hi @rcollette,

This request has to be coordinated with API teams that provide the OpenAPI specification. In the meantime, I recommend using WireMock to mock the server response. You can see some examples here.

I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants