TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit 1.0.0

dotnet add package TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit --version 1.0.0
                    
NuGet\Install-Package TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit --version 1.0.0
                    
#r "nuget: TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit&version=1.0.0
                    
Install as a Cake Tool

TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit

This project depends on WPF Pilot, licensed under the WPF Pilot Split License. See the WPF Pilot license for applicable licensing terms.

Two NUnit base test classes to launch the TWindow in an app that uses --window=FullyQualifiedNameOfWindow.

WPFPilotTestBase

The exe is in the test output directory and is named the same as the assembly containing TWindow.

    public abstract class WPFPilotTestBase<TWindow> where TWindow : Window
    {
        protected AppDriver AppDriver { get; private set; } = null!;

        [SetUp]
        public void SetUp()
            => AppDriver = AppDriverWindowLauncher.LaunchWindow<TWindow>(GetExePath());

        private static string GetExePath()
        {
            var assemblyName = typeof(TWindow).Assembly.GetName().Name
                ?? throw new InvalidOperationException(
                    $"Could not determine assembly name for {typeof(TWindow).FullName}");

            return Path.Combine(
                AppContext.BaseDirectory,
                $"{assemblyName}.exe");
        }

        [TearDown]
        public void TearDown() => AppDriver.Dispose();
    }

SlnConventionWPFPilotTestBase

Exe path by convention.

e.g given test in assembly

"\TonyHallett.WPFExtras\TonyHallett.WPFExtras.UITests\bin\Debug\net10.0-windows\TonyHallett.WPFExtras.UITests.dll"

and TWindow in assembly TonyHallett.WPFExtras.TestHost

will replace the directory, TonyHallett.WPFExtras.UITests, in the path above with TonyHallett.WPFExtras.TestHost and have the exe file name as TonyHallett.WPFExtras.TestHost.exe

    public abstract class SlnConventionWPFPilotTestBase<TWindow> where TWindow : Window
    {
        protected AppDriver AppDriver { get; private set; } = null!;

        [SetUp]
        public void SetUp()
            => AppDriver = SlnConventionAppDriverWindowLauncher.LaunchWindow<TWindow>(GetType().Assembly);

        [TearDown]
        public void TearDown() => AppDriver.Dispose();
    }

Product Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 98 9/7/2026