Skip to content

"Customize WebApplicationFactory" section doesn't work with EF 9.0 #34584

Closed
@AndriySvyryd

Description

@AndriySvyryd

Description

The approach outlined in https://learn.microsoft.com/aspnet/core/test/integration-tests?view=aspnetcore-9.0#customize-webapplicationfactory no longer works. It was relying on implementation details, see #35126

It is also recommended to use the same provider for testing as the one used in production as they could have drastically different behaviors, see testing against the production database.

The connection / connection string for the same provider can be changed easily:

  services.ConfigureDbContext<TestContext>(options => options.UseSqlite(connection));

Page URL

https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-9.0#customize-webapplicationfactory

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/test/integration-tests.md

Document ID

f499b131-8b14-7e10-1728-543fdd5a5656

Article author

@tdykstra

Metadata

  • ID: 77889d43-fedb-f8b4-8fea-379ec946555c
  • Service: aspnet-core
  • Sub-service: testing

Related Issues


Associated WorkItem - 372359

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    "Customize WebApplicationFactory" section doesn't work with EF 9.0 · Issue #34584 · dotnet/AspNetCore.Docs