Maak niet-geverifieerde verzoek integratie testen in .NET Core 3.0

stemmen
0

Er was een mooie oplossing voor NET Core 2.2 gepost hier https://stackoverflow.com/a/50247041

protected override void ConfigureWebHost(IWebHostBuilder builder)
        {
            builder.ConfigureTestServices(services =>
            {
                services
                    .AddMvc(opts => opts.Filters.Add(new AllowAnonymousFilter()));
            });
        }

Blijkbaar is het gestopt met werken in .NET Core 3.0

Error Message:
   Expected response.StatusCode to be OK, but found Unauthorized.
  Stack Trace:
     at FluentAssertions.Execution.LateBoundTestFramework.Throw(String message)
   at FluentAssertions.Execution.TestFrameworkProvider.Throw(String message)
   at FluentAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message)
   at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc)
   at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc)
   at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args)
   at FluentAssertions.Primitives.ObjectAssertions.Be(Object expected, String because, Object[] becauseArgs)

Weet iemand of er een soortgelijke oplossing voor de nieuwe .NET Core?

De vraag is gesteld op 24/10/2019 om 12:59
bron van user
In andere talen...                            

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more