Skip to content
Discussion options

You must be logged in to vote

Since #2958 was merged, you can implement your own engine to wrap the default engine.

public class AvaloniaEngineFactory : IEngineFactory
{
    public IEngine Create(EngineParameters engineParameters) => new AvaloniaEngine(engineParameters);
}

public class AvaloniaEngine(EngineParameters engineParameters) : IEngine
{
    public async ValueTask<RunResults> RunAsync()
    {
        using var session = HeadlessUnitTestSession.StartNew(typeof(App));
        return await session.Dispatch(
            async () => await new EngineFactory().Create(engineParameters).RunAsync(),
            engineParameters.Host.CancellationToken
        );
    }
}

Then pass the factory to the config job Job.Defau…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by maxkatz6
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