Extends Verify to allow verification of WinForms UIs.
See Milestones for release notes.
https://nuget.org/packages/Verify.WinForms/
[ModuleInitializer]
public static void Init() =>
VerifyWinForms.Initialize();
A visual element (Form/Control etc) can be verified as follows:
[Test]
public Task FormUsage() =>
Verify(new MyForm());
With the state of the element being rendered as a verified file:
TheTests.FormUsage.Net.verified.png:
A ContextMenuStrip
can be verified as follows:
[Test]
public Task ContextMenuStrip()
{
var menu = new ContextMenuStrip();
var items = menu.Items;
items.Add(new ToolStripMenuItem("About"));
items.Add(new ToolStripMenuItem("Exit"));
return Verify(menu);
}
With the state of the element being rendered as a verified file:
TheTests.FormUsage.Net.verified.png:
The rendering of Form 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:
- Using a custom comparer
Gem designed by Adnen Kadri from The Noun Project.