-
Notifications
You must be signed in to change notification settings - Fork 32
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
Unit Testing Isolated Model Azure Durable Function Orchestrator in .Net 8 #266
Comments
This can be achieved with a bit of boilerplate code and some fakes. What I personally did is :
My fake class looks as follows :
I also had to create a fake of
If I take your example, the following should work using those fakes :
I cannot guarantee it works with every use-case (I didn't test it with the Entities so far) and it doesn't really feel natural. I would appreciate a more comfortable out-of-the-box solution. But until now, I don't have any better idea. |
Thank you. Yes, this does provide a workaround to test some basic functionalities. I should be able to do the same for the activity function as well. |
@arnaudleclerc your example was very helpful.
I'm not sure if I need to implement all of the methods, but I just decided to implement what I would be using directly.
But when the code reaches Am I doing something wrong there? |
@Kruti-Joshi the null reference exception might be related to how you're mocking the |
Following :) |
@Kruti-Joshi |
The documentation for Durable Function Testing only talks about the in-proc model - https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-unit-testing
I have a timer-triggered orchestrator as below -
In the below test, I get an error that DurableTaskClient cannot be mocked -
Is there any way to test isolated durable orchestrators today?
The text was updated successfully, but these errors were encountered: