115 references to WithWebHostBuilder
Microsoft.AspNetCore.Identity.FunctionalTests (33)
AuthorizationTests.cs (1)
143
var client = ServerFactory.
WithWebHostBuilder
(whb => whb.ConfigureServices(TestServicesConfiguration))
LoginTests.cs (13)
47
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
90
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
136
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
162
var server = ServerFactory.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
187
var server = ServerFactory.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
211
var server = ServerFactory.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
238
var server = ServerFactory.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
266
var server = ServerFactory.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
291
var server = ServerFactory.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
313
var server = ServerFactory.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
335
var server = ServerFactory.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
365
var server = ServerFactory.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
395
var server = ServerFactory.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
ManagementTests.cs (8)
65
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
89
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
120
.
WithWebHostBuilder
(whb => whb.ConfigureTestServices(ConfigureTestServices));
157
.
WithWebHostBuilder
(whb => whb.ConfigureTestServices(ConfigureTestServices));
197
.
WithWebHostBuilder
(whb => whb.ConfigureTestServices(ConfigureTestServices));
221
.
WithWebHostBuilder
(whb => whb.ConfigureTestServices(ConfigureTestServices));
247
.
WithWebHostBuilder
(whb => whb.ConfigureTestServices(ConfigureTestServices));
281
.
WithWebHostBuilder
(whb => whb.ConfigureTestServices(ConfigureTestServices))
NoIdentityAddedTests.cs (1)
28
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices))
RegistrationTests.cs (10)
30
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices))
47
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
80
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices));
102
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices))
121
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices))
143
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices))
168
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices))
189
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices))
210
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices))
234
.
WithWebHostBuilder
(whb => whb.ConfigureServices(ConfigureTestServices))
Microsoft.AspNetCore.Mvc.FunctionalTests (81)
ApiBehaviorTest.cs (2)
26
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
429
.
WithWebHostBuilder
(ConfigureWebHostBuilder);
AsyncDisposalTest.cs (1)
22
Factory = new MvcTestFixture<BasicWebSite.Startup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
AuthMiddlewareAndFilterTestBase.cs (1)
20
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
AuthMiddlewareUsingRequireAuthTest.cs (1)
19
Factory = new MvcTestFixture<SecurityWebSite.StartupWithRequireAuth>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
ClientValidationOptionsTests.cs (1)
32
.
WithWebHostBuilder
(whb => whb.UseStartup<RazorPagesWebSite.StartupWithClientValidationDisabled>())
ComponentRenderingFunctionalTests.cs (5)
52
var client = CreateClient(Factory.
WithWebHostBuilder
(builder =>
68
var fixture = Factory.
WithWebHostBuilder
(builder => builder.ConfigureServices(services => services.AddServerSideBlazor()));
83
var client = CreateClient(Factory.
WithWebHostBuilder
(builder =>
99
var client = CreateClient(Factory.
WithWebHostBuilder
(builder =>
196
.
WithWebHostBuilder
(builder => builder.ConfigureServices(ConfigureTestWeatherForecastService))
ConsumesAttributeTestsBase.cs (1)
24
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
ControllerEndpointFiltersTest.cs (1)
23
Factory = new MvcTestFixture<StartupForEndpointFilters>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
CorsTestsBase.cs (1)
20
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
CustomValueProviderTest.cs (2)
24
.
WithWebHostBuilder
(b => b.UseStartup<BasicWebSite.StartupWithCustomValueProvider>())
25
.
WithWebHostBuilder
(b => b.ConfigureTestServices(serviceCollection => _serviceCollection = serviceCollection));
DataAnnotationTests.cs (1)
21
.
WithWebHostBuilder
(builder =>
ErrorPageTests.cs (3)
33
.
WithWebHostBuilder
(b => b.UseStartup<ErrorPageMiddlewareWebSite.Startup>());
52
var factory = Factory.
WithWebHostBuilder
(b => b.UseStartup<ErrorPageMiddlewareWebSite.Startup>());
53
factory = factory.
WithWebHostBuilder
(b => b.ConfigureTestServices(serviceCollection => serviceCollection.Configure<MvcRazorRuntimeCompilationOptions>(ConfigureRuntimeCompilationOptions)));
GlobalAuthorizationFilterTestBase.cs (1)
19
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
HtmlGenerationTest.cs (3)
25
Factory = new MvcTestFixture<HtmlGenerationWebSite.Startup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
26
EncodedFactory = new MvcEncodedTestFixture<HtmlGenerationWebSite.Startup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
217
.
WithWebHostBuilder
(builder => builder.UseStartup<HtmlGenerationWebSite.StartupWithoutEndpointRouting>())
HtmlGenerationWithCultureTest.cs (2)
28
.
WithWebHostBuilder
(builder => builder.UseStartup<StartupWithCultureReplace>());
140
.
WithWebHostBuilder
(builder => builder
InputParentValidationTests.cs (1)
28
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(builder => builder.UseStartup<TStartup>());
JsonInputFormatterTestBase.cs (1)
26
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
JsonOutputFormatterTestBase.cs (1)
27
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
JsonResultWithNewtonsoftJsonTest.cs (2)
24
.
WithWebHostBuilder
(b => b.ConfigureTestServices(serviceCollection => _serviceCollection = serviceCollection))
25
.
WithWebHostBuilder
(b => b.UseStartup<BasicWebSite.StartupWithNewtonsoftJson>());
JsonResultWithSystemTextJsonTest.cs (2)
24
.
WithWebHostBuilder
(b => b.ConfigureTestServices(serviceCollection => _serviceCollection = serviceCollection))
25
.
WithWebHostBuilder
(b => b.UseStartup<BasicWebSite.StartupWithSystemTextJson>());
LinkGeneratorTest.cs (2)
23
Factory = new MvcTestFixture<RoutingWebSite.StartupForLinkGenerator>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder)
24
.
WithWebHostBuilder
(ConfigureWebHostBuilder);
LinkParserTest.cs (1)
24
Factory = new MvcTestFixture<RoutingWebSite.StartupForLinkGenerator>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
PageAsyncDisposalTest.cs (1)
25
Factory = new MvcTestFixture<RazorPagesWebSite.StartupWithoutEndpointRouting>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RazorBuildTest.cs (2)
28
.
WithWebHostBuilder
(b => b.UseStartup<RazorBuildWebSite.Startup>())
29
.
WithWebHostBuilder
(b => b.ConfigureTestServices(serviceCollection => serviceCollection.Configure<MvcRazorRuntimeCompilationOptions>(ConfigureRuntimeCompilationOptions)));
RazorPageModelTest.cs (1)
22
Factory = new MvcTestFixture<RazorPagesWebSite.StartupWithoutEndpointRouting>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RazorPagesNamespaceTest.cs (1)
21
Factory = new MvcTestFixture<RazorPagesWebSite.StartupWithoutEndpointRouting>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RazorPagesTest.cs (1)
29
Factory = new MvcTestFixture<RazorPagesWebSite.StartupWithoutEndpointRouting>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RazorPagesViewSearchTest.cs (1)
21
Factory = new MvcTestFixture<RazorPagesWebSite.StartupWithoutEndpointRouting>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RazorRuntimeCompilationHostingStartupTest.cs (2)
25
.
WithWebHostBuilder
(b => b.UseStartup<RazorBuildWebSite.StartupWithHostingStartup>())
26
.
WithWebHostBuilder
(b => b.ConfigureTestServices(serviceCollection => serviceCollection.Configure<MvcRazorRuntimeCompilationOptions>(ConfigureRuntimeCompilationOptions)));
ReadFromDisconnectedClientTest.cs (1)
25
Factory = new MvcTestFixture<BasicWebSite.StartupWhereReadingRequestBodyThrows>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RequestFormLimitsTest.cs (1)
22
Factory = new MvcTestFixture<BasicWebSite.StartupRequestLimitSize>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RequestServicesTestBase.cs (1)
25
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RequestSizeLimitTest.cs (1)
23
Factory = new MvcTestFixture<BasicWebSite.StartupRequestLimitSize>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RespectBrowserAcceptHeaderTests.cs (1)
26
Factory = new MvcTestFixture<FormatterWebSite.StartupWithRespectBrowserAcceptHeader>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RoutingAcrossPipelineBranchesTest.cs (1)
23
Factory = new MvcTestFixture<RoutingWebSite.StartupRoutingDifferentBranches>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RoutingDynamicOrderTest.cs (7)
23
Factory = new MvcTestFixture<RoutingWebSite.StartupForDynamic>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
38
.
WithWebHostBuilder
(b => b.UseSetting("Scenario", RoutingWebSite.StartupForDynamicOrder.DynamicOrderScenarios.AttributeRouteDynamicRoute));
60
.
WithWebHostBuilder
(b => b.UseSetting("Scenario", RoutingWebSite.StartupForDynamicOrder.DynamicOrderScenarios.MultipleDynamicRoute));
83
.
WithWebHostBuilder
(b => b.UseSetting("Scenario", RoutingWebSite.StartupForDynamicOrder.DynamicOrderScenarios.ConventionalRouteDynamicRoute));
105
.
WithWebHostBuilder
(b => b.UseSetting("Scenario", RoutingWebSite.StartupForDynamicOrder.DynamicOrderScenarios.ConventionalRouteDynamicRoute));
128
.
WithWebHostBuilder
(b => b.UseSetting("Scenario", RoutingWebSite.StartupForDynamicOrder.DynamicOrderScenarios.DynamicControllerAndPages));
149
.
WithWebHostBuilder
(b => b.UseSetting("Scenario", RoutingWebSite.StartupForDynamicOrder.DynamicOrderScenarios.DynamicControllerAndPages));
RoutingDynamicTest.cs (3)
22
Factory = new MvcTestFixture<RoutingWebSite.StartupForDynamic>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
147
var client = Factory.
WithWebHostBuilder
(b => b.UseStartup<StartupForDynamicAndRazorPages>()).CreateDefaultClient();
164
var client = Factory.
WithWebHostBuilder
(b => b.UseStartup<StartupForDynamicAndRazorPages>()).CreateDefaultClient();
RoutingFallbackTest.cs (1)
23
Factory = new MvcTestFixture<RoutingWebSite.StartupForFallback>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RoutingGroupsTest.cs (1)
24
Factory = new MvcTestFixture<StartupForGroups>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RoutingGroupsWithMetadataTest.cs (1)
23
Factory = new MvcTestFixture<StartupForRouteGroupsWithMetadata>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RoutingTestsBase.cs (1)
23
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
RoutingWithoutRazorPagesTestsBase.cs (1)
23
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
SimpleWithWebApplicationBuilderTests.cs (3)
155
var fixture = Factory.
WithWebHostBuilder
(builder =>
182
var fixture = Factory.
WithWebHostBuilder
(builder =>
203
var fixture = Factory.
WithWebHostBuilder
(builder =>
SystemTextJsonOutputFormatterTest.cs (1)
36
var client = Factory.
WithWebHostBuilder
(c => c.ConfigureServices(ConfigureServices)).CreateClient();
TempDataInCookiesUsingCookieConsentTest.cs (1)
20
Factory = new MvcTestFixture<BasicWebSite.StartupWithCookieTempDataProviderAndCookieConsent>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
TempDataTestBase.cs (1)
20
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
TestingInfrastructureInheritanceTests.cs (6)
22
.
WithWebHostBuilder
(builder => factory.ConfigureWebHostCalled.Add("Customization"))
23
.
WithWebHostBuilder
(builder => factory.ConfigureWebHostCalled.Add("FurtherCustomization"));
42
.
WithWebHostBuilder
(builder => factory.ConfigureWebHostCalled.Add("Customization"))
43
.
WithWebHostBuilder
(builder => factory.ConfigureWebHostCalled.Add("FurtherCustomization"));
85
using var factory = new CustomizedFactory<GenericHostWebSite.Startup>().
WithWebHostBuilder
(ConfigureWebHostBuilder);
100
using var factory = new CustomizedFactory<GenericHostWebSite.Startup>().
WithWebHostBuilder
(ConfigureWebHostBuilder);
TestingInfrastructureTests.cs (2)
23
Factory = fixture.Factories.FirstOrDefault() ?? fixture.
WithWebHostBuilder
(ConfigureWebHostBuilder);
186
.
WithWebHostBuilder
(builder =>
VersioningTestsBase.cs (1)
23
Factory = new MvcTestFixture<TStartup>(LoggerFactory).
WithWebHostBuilder
(ConfigureWebHostBuilder);
Microsoft.AspNetCore.Mvc.Testing (1)
WebApplicationFactory.cs (1)
98
/// <see cref="WebApplicationFactory{TEntryPoint}.
WithWebHostBuilder
(Action{IWebHostBuilder})"/>.