skip to Main Content

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.

VIEW QUESTION

Unable to Deserialize Json data

I have a JSON data, which I want to Deserialize and load. I'm able to Deserialize and load with partial data, but not with all. Below is the code and the JSON data. public class Category { public string CategoryID…

VIEW QUESTION
Back To Top
Search