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

How to unit test HandleEventAsync(ProcessEventArgs args) in Azure.Messaging.EventHub library #419

Open
topagarwal opened this issue Sep 17, 2021 · 0 comments

Comments

@topagarwal
Copy link

We are migrating to Azure.Messaging.EventHubs.Processor v5.6.0 library from Microsoft.Azure.EventHubs.Processor v4.1.0. I m using await messageHandler.HandleEventAsync(args); where args is of ProcessEventArgs type. Most of our business logic that I want to unit test is based on EventData which is a property of ProcessEventArgs. Event data has Readonly dictionary of systemProperties and other properties. The public constructor of EventData does not let us specify the systemProperties or any other property other than EventData body.

Both ProcessEventArgs and EventBody do not have mockable interfaces. In such case can you please advise on how can we unit test the code using ProcessEventArgs?

Versions

  • OS platform and version:
  • .NET Version: .Net core app 3.1
  • NuGet package version : Azure.Messaging.EventHubs.Processor v5.6.0, Microsoft.NET.Test.Sdk v16.6.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant