Asp.net – How to mock dependency of service that has fuction with argument in type of 'async Function'?
I have a function here that is for getting the logs in the queue. How can I mock this function for unit testing ? void QueueBackgroundWorkItem(Func<CancellationToken, IServiceProvider, Task> workItem); Mock<IBackgroundTaskQueue> _Mock= new Mock<IBackgroundTaskQueue>(); _Mock.Setup(x=>x.QueueBackgroundWorkItem(?)).Returns(Task.CompletedTask); Thank you.