Ejemplo n.º 1
0
 // Copy constructor
 internal WebApplicationFactoryClientOptions(WebApplicationFactoryClientOptions clientOptions)
 {
     BaseAddress              = clientOptions.BaseAddress;
     AllowAutoRedirect        = clientOptions.AllowAutoRedirect;
     MaxAutomaticRedirections = clientOptions.MaxAutomaticRedirections;
     HandleCookies            = clientOptions.HandleCookies;
 }
 public DelegatedWebApplicationFactory(
     WebApplicationFactoryClientOptions options,
     Func <IWebHostBuilder, TestServer> createServer,
     Func <IWebHostBuilder> createWebHostBuilder,
     Func <IEnumerable <Assembly> > getTestAssemblies,
     Action <IWebHostBuilder> configureWebHost)
 {
     ClientOptions         = new WebApplicationFactoryClientOptions(options);
     _createServer         = createServer;
     _createWebHostBuilder = createWebHostBuilder;
     _getTestAssemblies    = getTestAssemblies;
     _configuration        = configureWebHost;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates an instance of <see cref="HttpClient"/> that automatically follows
 /// redirects and handles cookies.
 /// </summary>
 /// <returns>The <see cref="HttpClient"/>.</returns>
 public HttpClient CreateClient(WebApplicationFactoryClientOptions options) =>
 CreateDefaultClient(options.BaseAddress, options.CreateHandlers());
Ejemplo n.º 4
0
 private WebApplicationFactory(Action <IWebHostBuilder> configuration, WebApplicationFactoryClientOptions options)
 {
     _configuration = configuration;
     ClientOptions  = options;
 }