I have an Azure function in Isolated worker model type with .Net 8 version . I want to mock the function context for Unit testing.
Below code of Azure Function is given
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;
namespace FunctionApp1
{
public class Function1
{
[Function("Function1")]
public IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req,FunctionContext context)
{
var logger = context.GetLogger<Function1>();
logger.LogInformation("C# HTTP trigger function processed a request.");
return new OkObjectResult("Welcome to Azure Functions!");
}
}
}
I'm getting error when I tried to create FunctionContext object in unit test since it is an abstract class.

