Share via

Integration tests with .net 5

Anubhav Mathur 1 Reputation point
2021-11-16T06:50:15.527+00:00

I have created a console app using .net 5 target framework. In Program.cs, I am creating two hostedservice(services.AddHostedService) under two hosts(Host.CreateDefaultBuilder with some config). How would I bootstrap this in-memory for writing/running integration tests? I am not using WebHost(or other AspNetCore packages), so can I still use WebApplicationFactory for this scenario(and configure an empty web app)?

Community Center | Not monitored

Your answer

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