Creare richiesta non autenticata di test di integrazione in .NET 3.0 Nucleo

voti
0

C'era una bella soluzione per NET core 2.2 postato qui https://stackoverflow.com/a/50247041

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

A quanto pare ha smesso di funzionare in .NET 3.0 Nucleo

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)

Qualcuno sa se c'è una soluzione simile per il nuovo .NET Nucleo?

È pubblicato 24/10/2019 alle 12:59
fonte dall'utente
In altre lingue...                            

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