Furion
Furion copied to clipboard
Furion documentation - unittest
请问单元测试中如何注入配置文件
Net6下是不是不需要.UseStartup<Startup>());呢,加了后提示: Scheme already exists: Bearer 在哪里的AddAuthentication多次注入了AddJwtBearer,项目里面也注入了jwt?
发现每次都要create一个新的scope才能继续:
[Fact] public async Task Test_JobService() { using (var scope = _factory.Services.CreateScope()) { var _job = scope.ServiceProvider.GetRequiredService<IJobService>();