Furion icon indicating copy to clipboard operation
Furion copied to clipboard

Furion documentation - unittest

Open monksoul opened this issue 4 years ago • 3 comments

monksoul avatar Dec 16 '21 09:12 monksoul

请问单元测试中如何注入配置文件

luodaoyi avatar Mar 02 '22 10:03 luodaoyi

Net6下是不是不需要.UseStartup<Startup>());呢,加了后提示: Scheme already exists: Bearer 在哪里的AddAuthentication多次注入了AddJwtBearer,项目里面也注入了jwt?

pccai avatar Jun 04 '22 07:06 pccai

发现每次都要create一个新的scope才能继续:

[Fact] public async Task Test_JobService() { using (var scope = _factory.Services.CreateScope()) { var _job = scope.ServiceProvider.GetRequiredService<IJobService>();

pccai avatar Jun 04 '22 14:06 pccai