C
C#4mo ago
Grimson

I can't get IApplicationBuilder to be not null in my test project

Hi, I am using xunit to add some test coverage to one of my projects. Furthermore, I am using Xunit.DependencyInjection to add inject correct services to my code. I believe I got that part working. However, I need to populate some data and use app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope(); (which I lifted off some scaffolding from the original project to be tested) and I cannot get the app to be not null in Configure(IApplicationBuilder app) method. Please help!
1 Reply
canton7
canton74mo ago
I'm afraid there's not much we can say other than "Something is wrong somewhere", which I think you already know If you can share a MCVE (https://stackoverflow.com/help/minimal-reproducible-example), we can try and spot any problems there
Want results from more Discord servers?
Add your server