xunit-maui
xunit-maui copied to clipboard
XUnit Device Runner for MAUI
Xunit.Runners.Maui
Ported From
- https://github.com/xunit/devices.xunit
- https://github.com/dotnet/maui/tree/main/src/TestUtils
Setup
- Create a new MAUI application.
- Delete the standard App.xaml & App.xaml.cs
- Install Xunit.Runners.Maui nuget
- Create tests in this project or reference another project containing your tests.
- Create a MauiProgram like shown below - NOTE: It is not recommended you put any dependencies here
using Xunit.Runners.Maui;
namespace Sample
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp() => MauiApp
.CreateBuilder()
.ConfigureTests(new TestOptions
{
Assemblies =
{
typeof(MauiProgram).Assembly
}
})
.UseVisualRunner()
.Build();
}
}