Skip to content

Show how to change the provider when using WebApplicationFactory #4149

Open
@AndriySvyryd

Description

@AndriySvyryd

When using WebApplicationFactory to test the app changing the provider is currently not straightforward. See https://github.com/davidfowl/TodoApi/blob/aa5761d4ad3c516eae27d8a7fa41d8b97c812d63/TodoApi.Tests/DbContextExtensions.cs and https://github.com/davidfowl/TodoApi/blob/aa5761d4ad3c516eae27d8a7fa41d8b97c812d63/TodoApi.Tests/TodoApplication.cs#L39-L46

We should have specific guidance on how this can be done without bringing new dependencies to the app.

This can be simplified by adding AddDbContextOptions to EF

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions