TonyHallett.WPFExtras.TestTools 1.0.0

dotnet add package TonyHallett.WPFExtras.TestTools --version 1.0.0
                    
NuGet\Install-Package TonyHallett.WPFExtras.TestTools -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" 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" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="TonyHallett.WPFExtras.TestTools" />
                    
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 --version 1.0.0
                    
#r "nuget: TonyHallett.WPFExtras.TestTools, 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@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&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=TonyHallett.WPFExtras.TestTools&version=1.0.0
                    
Install as a Cake Tool

Helpers for testing WPF.

SlnConventionExePathFinder

public static string GetPath(Assembly fromAssembly, Assembly exeAssembly)

Provides the path to an exe file given a specific solution directory structure. This allow a test to provide its own assembly and get the exe to pass to a UI testing framework, such as FlaUI or WPFPilot.

e.g given fromAssembly

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

and exe Assembly with name 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

resulting in

`\TonyHallett.WPFExtras\TonyHallett.WPFExtras.TestHost\bin\Debug\net10.0-windows\TonyHallett.WPFExtras.TestHost.exe"

Note that this helper is used by TonyHallett.WPFExtras.TestTools.WPFPilot SlnConventionAppDriverWindowLauncher which in turn is used by the base NUnit test class of TonyHallett.WPFExtras.TestTools.WPFPilot.NUnit. SlnConventionAppDriverWindowLauncher launches an app that uses TestHostApp.ShowWindow.

    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();
    }

TestHostApp.ShowWindow(StartupEventArgs e)

A helper to be used from WPF Applications to show a window by app argument --window=FullyQualifiedNameOfWindow. The windows are tested by a UI testing framework, such as FlaUI or WPFPilot.
Activator.CreateInstance is used.

    public partial class App : Application
    {
        public App()
        {
            Startup += (_, e) => TestHostApp.ShowWindow(e);
        }
    }
Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0-windows7.0

    • No dependencies.
  • net8.0-windows7.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TonyHallett.WPFExtras.TestTools:

Package Downloads
TonyHallett.WPFExtras.TestTools.WPFPilot

Helpers for WPFPilot

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 107 9/7/2026