Forum Discussion
Lakshmi_145
Dec 21, 2022Iron Contributor
Alternative method for using Middleware in CloudAdapter
In BotFrameworkAdapter ,we have method called 'Use(IMiddleware middleware)' to add middleware to adapter pipeline. We were able to use this method to unit test the middleware functions.
Now we have upgraded to .Net 6 and now using Cloud Adapter. But in this one we couldn't found any method to pass middleware object for unit testing.
Is there any alternative method to add middleware object to adapter pipeline in Cloud Adapter
5 Replies
Sort By
- Sayali-MSFT
Microsoft
Lakshmi_145 - CloudAdapter.ConnectNamedPipeAsync Method -Used to connect the adapter to a named pipe.
Reference Document-https://learn.microsoft.com/en-us/dotnet/api/microsoft.bot.builder.integration.aspnet.core.cloudadapter?view=botbuilder-dotnet-stable#properties- Lakshmi_145Iron Contributor
I wanted to add the middleware to cloud adapter for unit testing.
In ConnectNamedPipeAsync(string pipeName, IBot bot, string audience = null) , its passing bot as parameter. Instead we need to add middleware to cloud adapter for testing purpose
- ChetanSharma-msft
Microsoft
Hello Lakshmi_145 - Could you please share your code snippets that you have used for 'Use(IMiddleware middleware)' in BotFrameworkAdapter and how are you trying it for CloudAdapter for your unit tests?.
So that we can check on it from our end?
- Sayali-MSFT
Microsoft
Lakshmi_145 - Thanks for reporting your issue.
We will check this at our end and will get back to you.