3

We have a console app that uses dotnet core bodyBuilder to run an instance of AzureEventProcessor host.

I would like to be able to run end to end tests against the console app but have not been able to replace the AzureEventProcessorHost with an inMemory version because it is a sealed class and have not been able to find any mock implements online.

Has anyone done this before? Can you provide me with and example or an alternative way of running end to end tests against a console based AzureEventProcessorHost?

Farhad-Taran
  • 6,282
  • 15
  • 67
  • 121

1 Answers1

1

There is a long running discussion of this issue and how to mock events on Github. Some additional functionality to address this in particular is in the release pipeline. https://github.com/Azure/azure-event-hubs-dotnet/issues/24

While I understand that it isn't ideal, if you are willing to use an EventHub as part of your testing, you can send the messages to the EventHub as part of your test and then wait for the processor to receive and handle them.

PerfectlyPanda
  • 3,271
  • 1
  • 6
  • 17