Verify.Xaml
Extends Verify to allow verification of Xaml UIs.
NuGet package
https://nuget.org/packages/Verify.Xaml/
Usage
[ModuleInitializer]
public static void Init() =>
VerifyXaml.Enable();
A visual element (Window/Page/Control etc) can then be verified as follows:
[Test]
public async Task WindowUsage()
{
var window = new MyWindow();
await Verify(window);
}
With the state of the element being rendered as a verified files:
TheTests.WindowUsage.00.verified.xml:
TheTests.WindowUsage.01.verified.png:
OS specific rendering
The rendering of XAML elements can very slightly between different OS versions. This can make verification on different machines (eg CI) problematic. There are several approaches to mitigate this:
Icon
Gem designed by Adnen Kadri from The Noun Project.