How to mock TaskOrchestrationContext and FunctionContext to get the logger for xUnit Tests in .NET 8 isolated?

Khrystyna Stefaniv Selvestrova 0 Reputation points
2024-07-24T12:51:16.5266667+00:00

If I try to test the activity, fails because it can't mock context and get the mocked logger.

Also fails when try to test the http_start, can't create a mocked HttpResponseData.

It's a simple durable function with one activity, .net 8 isolated

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,973 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,836 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.