OverviewFilesCommitsIssuesDocsReleasesPeers

ifsrenderer-linux / AvaloniaShell.Tests / TestAppBuilder.cs

21 lines · csharp ref:
using Avalonia;
using Avalonia.Headless;

using IFSRenderer.AvaloniaShell;

[assembly: AvaloniaTestApplication(typeof(IFSRenderer.AvaloniaShell.Tests.TestAppBuilder))]

namespace IFSRenderer.AvaloniaShell.Tests;

/// <summary>
/// Boots the real <see cref="App"/> — Material theme and all — on Avalonia's headless
/// platform, so tests exercise the same visual tree the user gets, with no display server,
/// no compositor and no GPU.
/// </summary>
public static class TestAppBuilder
{
    public static AppBuilder BuildAvaloniaApp() => AppBuilder
        .Configure<App>()
        .UseHeadless(new AvaloniaHeadlessPlatformOptions { UseHeadlessDrawing = true });
}