5 types derived from WebApplicationFactory
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Infrastructure\ServerFactory.cs (1)
17
public class ServerFactory<TStartup, TContext> :
WebApplicationFactory
<TStartup>
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
Infrastructure\MvcTestFixture.cs (1)
15
public class MvcTestFixture<TStartup> :
WebApplicationFactory
<TStartup>
TestingInfrastructureInheritanceTests.cs (1)
129
private class CustomizedFactory<TEntryPoint> :
WebApplicationFactory
<TEntryPoint> where TEntryPoint : class
Microsoft.AspNetCore.Mvc.Testing (1)
WebApplicationFactory.cs (1)
607
private sealed class DelegatedWebApplicationFactory :
WebApplicationFactory
<TEntryPoint>
Microsoft.AspNetCore.OpenApi.Tests (1)
Integration\SampleAppFixture.cs (1)
7
public class SampleAppFixture :
WebApplicationFactory
<Program>
7 instantiations of WebApplicationFactory
Microsoft.AspNetCore.Mvc.FunctionalTests (7)
SimpleWithWebApplicationBuilderTests.cs (1)
142
using var client = new
WebApplicationFactory
<SimpleWebSiteWithWebApplicationBuilder.Program>().CreateClient();
TestingInfrastructureTests.cs (6)
46
using var factory = new
WebApplicationFactory
<ClassLibraryStartup>();
185
using var factory = new
WebApplicationFactory
<GenericHostWebSite.Program>()
197
using var factory = new
WebApplicationFactory
<BasicWebSite.Program>();
206
using var factory = new
WebApplicationFactory
<BasicWebSite.Startup>();
215
using var factory = new
WebApplicationFactory
<GenericHostWebSite.Program>();
224
using var factory = new
WebApplicationFactory
<GenericHostWebSite.Startup>();
141 references to WebApplicationFactory
AuthSamples.FunctionalTests (16)
ClaimsTransformTests.cs (2)
12
public class ClaimsTransformTests : IClassFixture<
WebApplicationFactory
<ClaimsTransformer.Startup>>
14
public ClaimsTransformTests(
WebApplicationFactory
<ClaimsTransformer.Startup> fixture)
CookiesTests.cs (2)
13
public class CookiesTests : IClassFixture<
WebApplicationFactory
<Cookies.Startup>>
15
public CookiesTests(
WebApplicationFactory
<Cookies.Startup> fixture)
CustomAuthorizationFailureResponseTests.cs (2)
12
public class CustomAuthorizationFailureResponseTests : IClassFixture<
WebApplicationFactory
<CustomAuthorizationFailureResponse.Startup>>
16
public CustomAuthorizationFailureResponseTests(
WebApplicationFactory
<CustomAuthorizationFailureResponse.Startup> fixture)
CustomPolicyProviderTests.cs (2)
15
public class CustomPolicyProviderTests : IClassFixture<
WebApplicationFactory
<CustomPolicyProvider.Startup>>
17
public CustomPolicyProviderTests(
WebApplicationFactory
<CustomPolicyProvider.Startup> fixture)
DynamicSchemeTests.cs (2)
13
public class DynamicSchemeTests : IClassFixture<
WebApplicationFactory
<DynamicSchemes.Startup>>
15
public DynamicSchemeTests(
WebApplicationFactory
<DynamicSchemes.Startup> fixture)
IdentityExternalClaimsTests.cs (2)
12
public class IdentityExternalClaimsTests : IClassFixture<
WebApplicationFactory
<Identity.ExternalClaims.Startup>>
14
public IdentityExternalClaimsTests(
WebApplicationFactory
<Identity.ExternalClaims.Startup> fixture)
PathSchemeSelectionTests.cs (2)
13
public class PathSchemeSelectionTests : IClassFixture<
WebApplicationFactory
<PathSchemeSelection.Startup>>
15
public PathSchemeSelectionTests(
WebApplicationFactory
<PathSchemeSelection.Startup> fixture)
StaticFilesAuthTests.cs (2)
12
public class StaticFilesAuthTests : IClassFixture<
WebApplicationFactory
<StaticFilesAuth.Startup>>
14
public StaticFilesAuthTests(
WebApplicationFactory
<StaticFilesAuth.Startup> fixture)
Microsoft.AspNetCore.Identity.FunctionalTests (22)
LoginTests.cs (13)
46
var
server = ServerFactory
89
var
server = ServerFactory
135
var
server = ServerFactory
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 (7)
64
var
server = ServerFactory
88
var
server = ServerFactory
119
var
server = ServerFactory
156
var
server = ServerFactory
196
var
server = ServerFactory
220
var
server = ServerFactory
246
var
server = ServerFactory
RegistrationTests.cs (2)
46
var
server = ServerFactory
79
var
server = ServerFactory
Microsoft.AspNetCore.Mvc.FunctionalTests (77)
ApiBehaviorTest.cs (2)
39
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
428
await using
var
factory = new MvcTestFixture<BasicWebSite.StartupWithCustomInvalidModelStateFactory>(LoggerFactory)
AsyncDisposalTest.cs (1)
36
public
WebApplicationFactory
<BasicWebSite.Startup> Factory { get; private set; }
AuthMiddlewareAndFilterTestBase.cs (1)
32
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
AuthMiddlewareUsingRequireAuthTest.cs (1)
32
public
WebApplicationFactory
<SecurityWebSite.StartupWithRequireAuth> Factory { get; private set; }
ComponentRenderingFunctionalTests.cs (2)
68
var
fixture = Factory.WithWebHostBuilder(builder => builder.ConfigureServices(services => services.AddServerSideBlazor()));
191
WebApplicationFactory
<BasicWebSite.StartupWithoutEndpointRouting> fixture)
ConsumesAttributeTestsBase.cs (1)
37
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
ControllerEndpointFiltersTest.cs (1)
34
public
WebApplicationFactory
<StartupForEndpointFilters> Factory { get; private set; }
CorsTestsBase.cs (1)
33
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
CustomValueProviderTest.cs (1)
35
public
WebApplicationFactory
<BasicWebSite.StartupWithCustomValueProvider> Factory { get; private set; }
DataAnnotationTests.cs (1)
34
public
WebApplicationFactory
<StartupDataAnnotations> Factory { get; private set; }
DoNotRespectBrowserAcceptHeaderTests.cs (1)
35
public
WebApplicationFactory
<FormatterWebSite.Startup> Factory { get; private set; }
ErrorPageTests.cs (2)
45
public
WebApplicationFactory
<ErrorPageMiddlewareWebSite.Startup> Factory { get; private set; }
52
var
factory = Factory.WithWebHostBuilder(b => b.UseStartup<ErrorPageMiddlewareWebSite.Startup>());
FileResultTests.cs (1)
30
public
WebApplicationFactory
<FilesWebSite.Startup> Factory { get; private set; }
GlobalAuthorizationFilterTestBase.cs (1)
29
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
HtmlGenerationTest.cs (2)
38
public
WebApplicationFactory
<HtmlGenerationWebSite.Startup> Factory { get; private set; }
39
public
WebApplicationFactory
<HtmlGenerationWebSite.Startup> EncodedFactory { get; private set; }
HtmlGenerationWithCultureTest.cs (1)
38
public
WebApplicationFactory
<StartupWithCultureReplace> Factory { get; private set; }
HtmlHelperOptionsTest.cs (1)
29
public
WebApplicationFactory
<RazorWebSite.Startup> Factory { get; private set; }
InputObjectValidationTests.cs (1)
34
public
WebApplicationFactory
<FormatterWebSite.Startup> Factory { get; private set; }
InputParentValidationTests.cs (1)
38
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
JsonInputFormatterTestBase.cs (1)
36
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
JsonOutputFormatterTestBase.cs (1)
37
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
JsonResultWithNewtonsoftJsonTest.cs (1)
35
public
WebApplicationFactory
<BasicWebSite.StartupWithNewtonsoftJson> Factory { get; private set; }
JsonResultWithSystemTextJsonTest.cs (1)
35
public
WebApplicationFactory
<BasicWebSite.StartupWithSystemTextJson> Factory { get; private set; }
LinkGenerationTests.cs (1)
37
public
WebApplicationFactory
<BasicWebSite.StartupWithoutEndpointRouting> Factory { get; private set; }
LinkGeneratorTest.cs (1)
34
public
WebApplicationFactory
<RoutingWebSite.StartupForLinkGenerator> Factory { get; private set; }
LinkParserTest.cs (1)
34
public
WebApplicationFactory
<RoutingWebSite.StartupForLinkGenerator> Factory { get; private set; }
PageAsyncDisposalTest.cs (1)
35
public
WebApplicationFactory
<RazorPagesWebSite.StartupWithoutEndpointRouting> Factory { get; private set; }
RazorBuildTest.cs (1)
49
public
WebApplicationFactory
<RazorBuildWebSite.Startup> Factory { get; private set; }
RazorPageModelTest.cs (1)
32
public
WebApplicationFactory
<RazorPagesWebSite.StartupWithoutEndpointRouting> Factory { get; private set; }
RazorPagesNamespaceTest.cs (1)
31
public
WebApplicationFactory
<RazorPagesWebSite.StartupWithoutEndpointRouting> Factory { get; private set; }
RazorPagesTest.cs (1)
39
public
WebApplicationFactory
<RazorPagesWebSite.StartupWithoutEndpointRouting> Factory { get; private set; }
RazorPagesViewSearchTest.cs (1)
31
public
WebApplicationFactory
<RazorPagesWebSite.StartupWithoutEndpointRouting> Factory { get; private set; }
RazorRuntimeCompilationHostingStartupTest.cs (1)
46
public
WebApplicationFactory
<RazorBuildWebSite.StartupWithHostingStartup> Factory { get; private set; }
ReadFromDisconnectedClientTest.cs (1)
35
public
WebApplicationFactory
<BasicWebSite.StartupWhereReadingRequestBodyThrows> Factory { get; private set; }
RequestFormLimitsTest.cs (1)
32
public
WebApplicationFactory
<BasicWebSite.StartupRequestLimitSize> Factory { get; private set; }
RequestServicesTestBase.cs (1)
35
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
RequestSizeLimitTest.cs (1)
33
public
WebApplicationFactory
<BasicWebSite.StartupRequestLimitSize> Factory { get; private set; }
RespectBrowserAcceptHeaderTests.cs (1)
36
public
WebApplicationFactory
<StartupWithRespectBrowserAcceptHeader> Factory { get; private set; }
RoutingAcrossPipelineBranchesTest.cs (1)
33
public
WebApplicationFactory
<RoutingWebSite.StartupRoutingDifferentBranches> Factory { get; private set; }
RoutingDynamicOrderTest.cs (7)
32
public
WebApplicationFactory
<RoutingWebSite.StartupForDynamic> Factory { get; private set; }
37
var
factory = Factory
59
var
factory = Factory
82
var
factory = Factory
104
var
factory = Factory
127
var
factory = Factory
148
var
factory = Factory
RoutingDynamicTest.cs (1)
32
public
WebApplicationFactory
<RoutingWebSite.StartupForDynamic> Factory { get; private set; }
RoutingFallbackTest.cs (1)
33
public
WebApplicationFactory
<RoutingWebSite.StartupForFallback> Factory { get; private set; }
RoutingGroupsTest.cs (1)
34
public
WebApplicationFactory
<StartupForGroups> Factory { get; private set; }
RoutingGroupsWithMetadataTest.cs (1)
32
public
WebApplicationFactory
<StartupForRouteGroupsWithMetadata> Factory { get; private set; }
RoutingTestsBase.cs (1)
33
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
RoutingWithoutRazorPagesTestsBase.cs (1)
33
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
SimpleWithWebApplicationBuilderTests.cs (3)
155
var
fixture = Factory.WithWebHostBuilder(builder =>
182
var
fixture = Factory.WithWebHostBuilder(builder =>
203
var
fixture = Factory.WithWebHostBuilder(builder =>
TempDataInCookiesUsingCookieConsentTest.cs (1)
30
public
WebApplicationFactory
<BasicWebSite.StartupWithCookieTempDataProviderAndCookieConsent> Factory { get; private set; }
TempDataTestBase.cs (1)
30
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
TestingInfrastructureInheritanceTests.cs (4)
21
using
var
customized = factory
41
using
var
customized = factory
85
using
var
factory = new CustomizedFactory<GenericHostWebSite.Startup>().WithWebHostBuilder(ConfigureWebHostBuilder);
100
using
var
factory = new CustomizedFactory<GenericHostWebSite.Startup>().WithWebHostBuilder(ConfigureWebHostBuilder);
TestingInfrastructureTests.cs (9)
19
public class TestingInfrastructureTests : IClassFixture<
WebApplicationFactory
<BasicWebSite.StartupWithoutEndpointRouting>>
21
public TestingInfrastructureTests(
WebApplicationFactory
<BasicWebSite.StartupWithoutEndpointRouting> fixture)
30
public
WebApplicationFactory
<StartupWithoutEndpointRouting> Factory { get; }
46
using
var
factory = new WebApplicationFactory<ClassLibraryStartup>();
185
using
var
factory = new WebApplicationFactory<GenericHostWebSite.Program>()
197
using
var
factory = new WebApplicationFactory<BasicWebSite.Program>();
206
using
var
factory = new WebApplicationFactory<BasicWebSite.Startup>();
215
using
var
factory = new WebApplicationFactory<GenericHostWebSite.Program>();
224
using
var
factory = new WebApplicationFactory<GenericHostWebSite.Startup>();
VersioningTestsBase.cs (1)
33
public
WebApplicationFactory
<TStartup> Factory { get; private set; }
XmlDataContractSerializerFormattersWrappingTest.cs (1)
34
public
WebApplicationFactory
<Startup> Factory { get; private set; }
XmlSerializerFormattersWrappingTest.cs (1)
34
public
WebApplicationFactory
<Startup> Factory { get; private set; }
Microsoft.AspNetCore.Mvc.Testing (26)
WebApplicationFactory.cs (17)
33
private 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})"/>.
100
public 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>
115
public
WebApplicationFactory
<TEntryPoint> WithWebHostBuilder(Action<IWebHostBuilder> configuration) =>
118
internal virtual
WebApplicationFactory
<TEntryPoint> WithWebHostBuilderCore(Action<IWebHostBuilder> configuration)
192
typeof(
WebApplicationFactory
<TEntryPoint>).Name,
507
/// Configures <see cref="HttpClient"/> instances created by this <see cref="
WebApplicationFactory
{TEntryPoint}"/>.
587
foreach (
var
factory in _derivedFactories)
650
internal 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