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 parameter less constructor to ServiceBusMessageActions #25405

Closed
srivelicheti opened this issue Nov 18, 2021 · 2 comments
Closed

Add parameter less constructor to ServiceBusMessageActions #25405

srivelicheti opened this issue Nov 18, 2021 · 2 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus

Comments

@srivelicheti
Copy link

Library or service name.
Microsoft.Azure.WebJobs.Extensions.ServiceBus, Version=5.1.0.0

Is your feature request related to a problem? Please describe.
I am facing issue with being able to mock ServiceBusMessageActions for unit-testing purposes as it doesn't contain public parameter-less constructor.

I see that all of the methods on this ServiceBusMessageActions are virtual but, trying to mock ServiceBusMessageActions class would result in an exception because of the lack of parameter-less ctor.
image

Most of the other SDK classes like ServiceBusClient or ServiceBusMessageReceiver have a parameter-less ctor or have factory classes (like ServiceBusModelFactory) to aid in unit-testing. Can a parameter-less public ctor to ServiceBusMessageActions? If not what are the alternatives to be able to unit-test logic that depends on this ServiceBusMessageActions class?

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 18, 2021
@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. Functions needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Bus labels Nov 18, 2021
@jsquire
Copy link
Member

jsquire commented Nov 18, 2021

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Nov 18, 2021
@JoshLove-msft
Copy link
Member

A protected parameterless constructor makes sense here as this is like a client type.

@JoshLove-msft JoshLove-msft added this to the [2021] December milestone Nov 18, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus
Projects
None yet
Development

No branches or pull requests

4 participants
@jsquire @srivelicheti @JoshLove-msft and others