Skip to content
Discussion options

You must be logged in to vote

Try this:

public override IEnumerable<Func<ApplicationFixture<T>>> GenerateDataSources(DataGeneratorMetadata dataGeneratorMetadata)
    {
        ...
        foreach (var service in wantedServices)
        {
            var f = new ApplicationFixture<T>(...);

            dataGeneratorMetadata.TestBuilderContext.Current.Events.OnInitialize += async (_,_) =>
            {
                await f.InitializeAsync();
            }

            yield return () => f;
        }
    }

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@TheRumle
Comment options

@thomhurst
Comment options

Answer selected by TheRumle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants