-
-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathProgram.cs
More file actions
37 lines (32 loc) · 1.25 KB
/
Program.cs
File metadata and controls
37 lines (32 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Testing.Platform.Builder;
using Microsoft.UI.Dispatching;
using Microsoft.UI.Xaml;
using WinRT;
namespace ComputeSharp.D2D1.WinUI.Tests;
internal static class Program
{
[STAThread]
internal static int Main(string[] args)
{
return MainAsync(args).GetAwaiter().GetResult();
}
internal static async Task<int> MainAsync(string[] args)
{
ComWrappersSupport.InitializeComWrappers();
Application.Start((p) =>
{
DispatcherQueueSynchronizationContext context = new(DispatcherQueue.GetForCurrentThread());
SynchronizationContext.SetSynchronizationContext(context);
_ = new App();
});
ITestApplicationBuilder builder = await TestApplication.CreateBuilderAsync(args);
Microsoft.Testing.Platform.MSBuild.TestingPlatformBuilderHook.AddExtensions(builder, args);
Microsoft.Testing.Extensions.Telemetry.TestingPlatformBuilderHook.AddExtensions(builder, args);
Microsoft.VisualStudio.TestTools.UnitTesting.TestingPlatformBuilderHook.AddExtensions(builder, args);
using ITestApplication app = await builder.BuildAsync();
return await app.RunAsync();
}
}