小编Sam*_*amV的帖子

Override Startup in WebApplicationFactory does not map endpoints

I have configured an xUnit project to test an Identity Server implementation. I have created a TestStartup class which inherits Startup and overrides my Identity Server implementation for testing purposes. The problem is when I call my TestStartup using my custom WebApplicationFactory, my endpoints are not mapped. If I call Startup from my custom WebApplicationFactory, my endpoints are mapped.

Startup.cs

protected readonly IConfiguration _configuration;
protected readonly IWebHostEnvironment _webHostEnvironment;

public Startup(IConfiguration configuration, IWebHostEnvironment environment)
{
    _configuration = configuration;
    _webHostEnvironment …
Run Code Online (Sandbox Code Playgroud)

xunit.net asp.net-core identityserver4

2
推荐指数
1
解决办法
1126
查看次数

标签 统计

asp.net-core ×1

identityserver4 ×1

xunit.net ×1