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

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?The text was updated successfully, but these errors were encountered: