Exemple #1
0
        public MessagePackWebApiTests(WebApiHostFactory <MessagePackWebApi.Startup> factory)
        {
            var options = new Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactoryClientOptions()
            {
                BaseAddress              = new Uri("http://localhost"),
                AllowAutoRedirect        = false,
                HandleCookies            = false,
                MaxAutomaticRedirections = 0
            };

            client = factory.CreateClient(options);
        }
        public IntegrationTestFixture()
        {
            var clientOptions = new Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactoryClientOptions()
            {
                HandleCookies            = false,
                BaseAddress              = new Uri("http://localhost"),
                AllowAutoRedirect        = true,
                MaxAutomaticRedirections = 7
            };

            Factory = new AppFactory <TStartup>();
            Client  = Factory.CreateClient(clientOptions);
        }
Exemple #3
0
        private void SetupClient()
        {
            var clientOptions = new Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactoryClientOptions()
            {
                HandleCookies            = false,
                BaseAddress              = new Uri("http://localhost"),
                AllowAutoRedirect        = true,
                MaxAutomaticRedirections = 7
            };

            _server = new TestServer(new WebHostBuilder()
                                     .UseEnvironment("Development")
                                     .UseStartup <Startup>());
            Client = _server.CreateClient(clientOptions);
        }
Exemple #4
0
 public System.Net.Http.HttpClient CreateClient(Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactoryClientOptions options)
 {
     throw null;
 }