5 types derived from WebApplicationFactory
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Infrastructure\ServerFactory.cs (1)
17public class ServerFactory<TStartup, TContext> : WebApplicationFactory<TStartup>
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
Infrastructure\MvcTestFixture.cs (1)
15public class MvcTestFixture<TStartup> : WebApplicationFactory<TStartup>
TestingInfrastructureInheritanceTests.cs (1)
129private class CustomizedFactory<TEntryPoint> : WebApplicationFactory<TEntryPoint> where TEntryPoint : class
Microsoft.AspNetCore.Mvc.Testing (1)
WebApplicationFactory.cs (1)
607private sealed class DelegatedWebApplicationFactory : WebApplicationFactory<TEntryPoint>
Microsoft.AspNetCore.OpenApi.Tests (1)
Integration\SampleAppFixture.cs (1)
7public class SampleAppFixture : WebApplicationFactory<Program>
7 instantiations of WebApplicationFactory
Microsoft.AspNetCore.Mvc.FunctionalTests (7)
SimpleWithWebApplicationBuilderTests.cs (1)
142using var client = new WebApplicationFactory<SimpleWebSiteWithWebApplicationBuilder.Program>().CreateClient();
TestingInfrastructureTests.cs (6)
46using var factory = new WebApplicationFactory<ClassLibraryStartup>(); 185using var factory = new WebApplicationFactory<GenericHostWebSite.Program>() 197using var factory = new WebApplicationFactory<BasicWebSite.Program>(); 206using var factory = new WebApplicationFactory<BasicWebSite.Startup>(); 215using var factory = new WebApplicationFactory<GenericHostWebSite.Program>(); 224using var factory = new WebApplicationFactory<GenericHostWebSite.Startup>();
141 references to WebApplicationFactory
AuthSamples.FunctionalTests (16)
ClaimsTransformTests.cs (2)
12public class ClaimsTransformTests : IClassFixture<WebApplicationFactory<ClaimsTransformer.Startup>> 14public ClaimsTransformTests(WebApplicationFactory<ClaimsTransformer.Startup> fixture)
CookiesTests.cs (2)
13public class CookiesTests : IClassFixture<WebApplicationFactory<Cookies.Startup>> 15public CookiesTests(WebApplicationFactory<Cookies.Startup> fixture)
CustomAuthorizationFailureResponseTests.cs (2)
12public class CustomAuthorizationFailureResponseTests : IClassFixture<WebApplicationFactory<CustomAuthorizationFailureResponse.Startup>> 16public CustomAuthorizationFailureResponseTests(WebApplicationFactory<CustomAuthorizationFailureResponse.Startup> fixture)
CustomPolicyProviderTests.cs (2)
15public class CustomPolicyProviderTests : IClassFixture<WebApplicationFactory<CustomPolicyProvider.Startup>> 17public CustomPolicyProviderTests(WebApplicationFactory<CustomPolicyProvider.Startup> fixture)
DynamicSchemeTests.cs (2)
13public class DynamicSchemeTests : IClassFixture<WebApplicationFactory<DynamicSchemes.Startup>> 15public DynamicSchemeTests(WebApplicationFactory<DynamicSchemes.Startup> fixture)
IdentityExternalClaimsTests.cs (2)
12public class IdentityExternalClaimsTests : IClassFixture<WebApplicationFactory<Identity.ExternalClaims.Startup>> 14public IdentityExternalClaimsTests(WebApplicationFactory<Identity.ExternalClaims.Startup> fixture)
PathSchemeSelectionTests.cs (2)
13public class PathSchemeSelectionTests : IClassFixture<WebApplicationFactory<PathSchemeSelection.Startup>> 15public PathSchemeSelectionTests(WebApplicationFactory<PathSchemeSelection.Startup> fixture)
StaticFilesAuthTests.cs (2)
12public class StaticFilesAuthTests : IClassFixture<WebApplicationFactory<StaticFilesAuth.Startup>> 14public StaticFilesAuthTests(WebApplicationFactory<StaticFilesAuth.Startup> fixture)
Microsoft.AspNetCore.Identity.FunctionalTests (22)
LoginTests.cs (13)
46var server = ServerFactory 89var server = ServerFactory 135var server = ServerFactory 162var server = ServerFactory.WithWebHostBuilder(whb => whb.ConfigureServices(ConfigureTestServices)); 187var server = ServerFactory.WithWebHostBuilder(whb => whb.ConfigureServices(ConfigureTestServices)); 211var server = ServerFactory.WithWebHostBuilder(whb => whb.ConfigureServices(ConfigureTestServices)); 238var server = ServerFactory.WithWebHostBuilder(whb => whb.ConfigureServices(ConfigureTestServices)); 266var server = ServerFactory.WithWebHostBuilder(whb => whb.ConfigureServices(ConfigureTestServices)); 291var server = ServerFactory.WithWebHostBuilder(whb => whb.ConfigureServices(ConfigureTestServices)); 313var server = ServerFactory.WithWebHostBuilder(whb => whb.ConfigureServices(ConfigureTestServices)); 335var server = ServerFactory.WithWebHostBuilder(whb => whb.ConfigureServices(ConfigureTestServices)); 365var server = ServerFactory.WithWebHostBuilder(whb => whb.ConfigureServices(ConfigureTestServices)); 395var server = ServerFactory.WithWebHostBuilder(whb => whb.ConfigureServices(ConfigureTestServices));
ManagementTests.cs (7)
64var server = ServerFactory 88var server = ServerFactory 119var server = ServerFactory 156var server = ServerFactory 196var server = ServerFactory 220var server = ServerFactory 246var server = ServerFactory
RegistrationTests.cs (2)
46var server = ServerFactory 79var server = ServerFactory
Microsoft.AspNetCore.Mvc.FunctionalTests (77)
ApiBehaviorTest.cs (2)
39public WebApplicationFactory<TStartup> Factory { get; private set; } 428await using var factory = new MvcTestFixture<BasicWebSite.StartupWithCustomInvalidModelStateFactory>(LoggerFactory)
AsyncDisposalTest.cs (1)
36public WebApplicationFactory<BasicWebSite.Startup> Factory { get; private set; }
AuthMiddlewareAndFilterTestBase.cs (1)
32public WebApplicationFactory<TStartup> Factory { get; private set; }
AuthMiddlewareUsingRequireAuthTest.cs (1)
32public WebApplicationFactory<SecurityWebSite.StartupWithRequireAuth> Factory { get; private set; }
ComponentRenderingFunctionalTests.cs (2)
68var fixture = Factory.WithWebHostBuilder(builder => builder.ConfigureServices(services => services.AddServerSideBlazor())); 191WebApplicationFactory<BasicWebSite.StartupWithoutEndpointRouting> fixture)
ConsumesAttributeTestsBase.cs (1)
37public WebApplicationFactory<TStartup> Factory { get; private set; }
ControllerEndpointFiltersTest.cs (1)
34public WebApplicationFactory<StartupForEndpointFilters> Factory { get; private set; }
CorsTestsBase.cs (1)
33public WebApplicationFactory<TStartup> Factory { get; private set; }
CustomValueProviderTest.cs (1)
35public WebApplicationFactory<BasicWebSite.StartupWithCustomValueProvider> Factory { get; private set; }
DataAnnotationTests.cs (1)
34public WebApplicationFactory<StartupDataAnnotations> Factory { get; private set; }
DoNotRespectBrowserAcceptHeaderTests.cs (1)
35public WebApplicationFactory<FormatterWebSite.Startup> Factory { get; private set; }
ErrorPageTests.cs (2)
45public WebApplicationFactory<ErrorPageMiddlewareWebSite.Startup> Factory { get; private set; } 52var factory = Factory.WithWebHostBuilder(b => b.UseStartup<ErrorPageMiddlewareWebSite.Startup>());
FileResultTests.cs (1)
30public WebApplicationFactory<FilesWebSite.Startup> Factory { get; private set; }
GlobalAuthorizationFilterTestBase.cs (1)
29public WebApplicationFactory<TStartup> Factory { get; private set; }
HtmlGenerationTest.cs (2)
38public WebApplicationFactory<HtmlGenerationWebSite.Startup> Factory { get; private set; } 39public WebApplicationFactory<HtmlGenerationWebSite.Startup> EncodedFactory { get; private set; }
HtmlGenerationWithCultureTest.cs (1)
38public WebApplicationFactory<StartupWithCultureReplace> Factory { get; private set; }
HtmlHelperOptionsTest.cs (1)
29public WebApplicationFactory<RazorWebSite.Startup> Factory { get; private set; }
InputObjectValidationTests.cs (1)
34public WebApplicationFactory<FormatterWebSite.Startup> Factory { get; private set; }
InputParentValidationTests.cs (1)
38public WebApplicationFactory<TStartup> Factory { get; private set; }
JsonInputFormatterTestBase.cs (1)
36public WebApplicationFactory<TStartup> Factory { get; private set; }
JsonOutputFormatterTestBase.cs (1)
37public WebApplicationFactory<TStartup> Factory { get; private set; }
JsonResultWithNewtonsoftJsonTest.cs (1)
35public WebApplicationFactory<BasicWebSite.StartupWithNewtonsoftJson> Factory { get; private set; }
JsonResultWithSystemTextJsonTest.cs (1)
35public WebApplicationFactory<BasicWebSite.StartupWithSystemTextJson> Factory { get; private set; }
LinkGenerationTests.cs (1)
37public WebApplicationFactory<BasicWebSite.StartupWithoutEndpointRouting> Factory { get; private set; }
LinkGeneratorTest.cs (1)
34public WebApplicationFactory<RoutingWebSite.StartupForLinkGenerator> Factory { get; private set; }
LinkParserTest.cs (1)
34public WebApplicationFactory<RoutingWebSite.StartupForLinkGenerator> Factory { get; private set; }
PageAsyncDisposalTest.cs (1)
35public WebApplicationFactory<RazorPagesWebSite.StartupWithoutEndpointRouting> Factory { get; private set; }
RazorBuildTest.cs (1)
49public WebApplicationFactory<RazorBuildWebSite.Startup> Factory { get; private set; }
RazorPageModelTest.cs (1)
32public WebApplicationFactory<RazorPagesWebSite.StartupWithoutEndpointRouting> Factory { get; private set; }
RazorPagesNamespaceTest.cs (1)
31public WebApplicationFactory<RazorPagesWebSite.StartupWithoutEndpointRouting> Factory { get; private set; }
RazorPagesTest.cs (1)
39public WebApplicationFactory<RazorPagesWebSite.StartupWithoutEndpointRouting> Factory { get; private set; }
RazorPagesViewSearchTest.cs (1)
31public WebApplicationFactory<RazorPagesWebSite.StartupWithoutEndpointRouting> Factory { get; private set; }
RazorRuntimeCompilationHostingStartupTest.cs (1)
46public WebApplicationFactory<RazorBuildWebSite.StartupWithHostingStartup> Factory { get; private set; }
ReadFromDisconnectedClientTest.cs (1)
35public WebApplicationFactory<BasicWebSite.StartupWhereReadingRequestBodyThrows> Factory { get; private set; }
RequestFormLimitsTest.cs (1)
32public WebApplicationFactory<BasicWebSite.StartupRequestLimitSize> Factory { get; private set; }
RequestServicesTestBase.cs (1)
35public WebApplicationFactory<TStartup> Factory { get; private set; }
RequestSizeLimitTest.cs (1)
33public WebApplicationFactory<BasicWebSite.StartupRequestLimitSize> Factory { get; private set; }
RespectBrowserAcceptHeaderTests.cs (1)
36public WebApplicationFactory<StartupWithRespectBrowserAcceptHeader> Factory { get; private set; }
RoutingAcrossPipelineBranchesTest.cs (1)
33public WebApplicationFactory<RoutingWebSite.StartupRoutingDifferentBranches> Factory { get; private set; }
RoutingDynamicOrderTest.cs (7)
32public WebApplicationFactory<RoutingWebSite.StartupForDynamic> Factory { get; private set; } 37var factory = Factory 59var factory = Factory 82var factory = Factory 104var factory = Factory 127var factory = Factory 148var factory = Factory
RoutingDynamicTest.cs (1)
32public WebApplicationFactory<RoutingWebSite.StartupForDynamic> Factory { get; private set; }
RoutingFallbackTest.cs (1)
33public WebApplicationFactory<RoutingWebSite.StartupForFallback> Factory { get; private set; }
RoutingGroupsTest.cs (1)
34public WebApplicationFactory<StartupForGroups> Factory { get; private set; }
RoutingGroupsWithMetadataTest.cs (1)
32public WebApplicationFactory<StartupForRouteGroupsWithMetadata> Factory { get; private set; }
RoutingTestsBase.cs (1)
33public WebApplicationFactory<TStartup> Factory { get; private set; }
RoutingWithoutRazorPagesTestsBase.cs (1)
33public WebApplicationFactory<TStartup> Factory { get; private set; }
SimpleWithWebApplicationBuilderTests.cs (3)
155var fixture = Factory.WithWebHostBuilder(builder => 182var fixture = Factory.WithWebHostBuilder(builder => 203var fixture = Factory.WithWebHostBuilder(builder =>
TempDataInCookiesUsingCookieConsentTest.cs (1)
30public WebApplicationFactory<BasicWebSite.StartupWithCookieTempDataProviderAndCookieConsent> Factory { get; private set; }
TempDataTestBase.cs (1)
30public WebApplicationFactory<TStartup> Factory { get; private set; }
TestingInfrastructureInheritanceTests.cs (4)
21using var customized = factory 41using var customized = factory 85using var factory = new CustomizedFactory<GenericHostWebSite.Startup>().WithWebHostBuilder(ConfigureWebHostBuilder); 100using var factory = new CustomizedFactory<GenericHostWebSite.Startup>().WithWebHostBuilder(ConfigureWebHostBuilder);
TestingInfrastructureTests.cs (9)
19public class TestingInfrastructureTests : IClassFixture<WebApplicationFactory<BasicWebSite.StartupWithoutEndpointRouting>> 21public TestingInfrastructureTests(WebApplicationFactory<BasicWebSite.StartupWithoutEndpointRouting> fixture) 30public WebApplicationFactory<StartupWithoutEndpointRouting> Factory { get; } 46using var factory = new WebApplicationFactory<ClassLibraryStartup>(); 185using var factory = new WebApplicationFactory<GenericHostWebSite.Program>() 197using var factory = new WebApplicationFactory<BasicWebSite.Program>(); 206using var factory = new WebApplicationFactory<BasicWebSite.Startup>(); 215using var factory = new WebApplicationFactory<GenericHostWebSite.Program>(); 224using var factory = new WebApplicationFactory<GenericHostWebSite.Startup>();
VersioningTestsBase.cs (1)
33public WebApplicationFactory<TStartup> Factory { get; private set; }
XmlDataContractSerializerFormattersWrappingTest.cs (1)
34public WebApplicationFactory<Startup> Factory { get; private set; }
XmlSerializerFormattersWrappingTest.cs (1)
34public WebApplicationFactory<Startup> Factory { get; private set; }
Microsoft.AspNetCore.Mvc.Testing (26)
WebApplicationFactory.cs (17)
33private readonly List<WebApplicationFactory<TEntryPoint>> _derivedFactories = new(); 37/// Creates an instance of <see cref="WebApplicationFactory{TEntryPoint}"/>. This factory can be used to 40/// The <see cref="WebApplicationFactory{TEntryPoint}"/> will find the entry point class of <typeparamref name="TEntryPoint"/> 48/// In case an attribute with the right key can't be found, <see cref="WebApplicationFactory{TEntryPoint}"/> 64/// Finalizes an instance of the <see cref="WebApplicationFactory{TEntryPoint}"/> class. 72/// Gets the <see cref="TestServer"/> created by this <see cref="WebApplicationFactory{TEntryPoint}"/>. 84/// Gets the <see cref="IServiceProvider"/> created by the server associated with this <see cref="WebApplicationFactory{TEntryPoint}"/>. 98/// <see cref="WebApplicationFactory{TEntryPoint}.WithWebHostBuilder(Action{IWebHostBuilder})"/>. 100public IReadOnlyList<WebApplicationFactory<TEntryPoint>> Factories => _derivedFactories.AsReadOnly(); 108/// Creates a new <see cref="WebApplicationFactory{TEntryPoint}"/> with a <see cref="IWebHostBuilder"/> 114/// <returns>A new <see cref="WebApplicationFactory{TEntryPoint}"/>.</returns> 115public WebApplicationFactory<TEntryPoint> WithWebHostBuilder(Action<IWebHostBuilder> configuration) => 118internal virtual WebApplicationFactory<TEntryPoint> WithWebHostBuilderCore(Action<IWebHostBuilder> configuration) 192typeof(WebApplicationFactory<TEntryPoint>).Name, 507/// Configures <see cref="HttpClient"/> instances created by this <see cref="WebApplicationFactory{TEntryPoint}"/>. 587foreach (var factory in _derivedFactories) 650internal override WebApplicationFactory<TEntryPoint> WithWebHostBuilderCore(Action<IWebHostBuilder> configuration)
WebApplicationFactoryClientOptions.cs (5)
13/// <see cref="WebApplicationFactory{TEntryPoint}.CreateClient(WebApplicationFactoryClientOptions)"/>. 35/// <see cref="WebApplicationFactory{TEntryPoint}.CreateClient(WebApplicationFactoryClientOptions)"/>. 42/// <see cref="WebApplicationFactory{TEntryPoint}.CreateClient(WebApplicationFactoryClientOptions)"/> 50/// created by calling <see cref="WebApplicationFactory{TEntryPoint}.CreateClient(WebApplicationFactoryClientOptions)"/> 58/// <see cref="WebApplicationFactory{TEntryPoint}.CreateClient(WebApplicationFactoryClientOptions)"/>
WebApplicationFactoryContentRootAttribute.cs (4)
10/// Metadata that <see cref="WebApplicationFactory{TEntryPoint}"/> uses to find out the content 12/// <see cref="WebApplicationFactory{TEntryPoint}"/> will iterate over all the instances of 16/// <see cref="WebApplicationFactory{TEntryPoint}"/> will check for the existence of the marker 28/// key is used by <see cref="WebApplicationFactory{TEntryPoint}"/> to determine what of the