Skip to content

How can I inject something into ClassDataSource? #2478

@bazarniy

Description

@bazarniy

Hello!

I have CustomWebApplicationFactory and inject it into test class with SharedType.PerClass.
I have a class with pool of testcontainers and it must be SharedType.PerAssembly.

CustomWebApplicationFactory need the pool in InitializeAsync. I've tried to add ClassDataSource into CustomWebApplicationFactory but get compilation error because of requred property in ClassDataSource.

So is there some way to inject something into ClassDataSource class with TUnit? It will be pretty if I can add SharedType.PerAssembly into SharedType.PerClass etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions