Files
Terminal.Gui/Tests/TerminalGuiFluentTesting/With.cs
Tig 0baa881dc5 Fixes #4046 - Moves examples into ./Examples and fixes ./Tests (#4047)
* touching publish.yml

* Moved Examples into ./Examples

* Moved Benchmarks into ./Tests

* Moved Benchmarks into ./Tests

* Moved UICatalog into ./Examples

* Moved UICatalog into ./Examples 2

* Moved tests into ./Tests

* Updated nuget
2025-04-25 09:49:33 -06:00

42 lines
1.3 KiB
C#

using Terminal.Gui;
namespace TerminalGuiFluentTesting;
/// <summary>
/// Entry point to fluent assertions.
/// </summary>
public static class With
{
/// <summary>
/// Entrypoint to fluent assertions
/// </summary>
/// <param name="width"></param>
/// <param name="height"></param>
/// <param name="v2TestDriver">Which v2 v2TestDriver to use for the test</param>
/// <returns></returns>
public static GuiTestContext A<T> (int width, int height, V2TestDriver v2TestDriver) where T : Toplevel, new ()
{
return new (() => new T (), width, height,v2TestDriver);
}
/// <summary>
/// Overload that takes an existing instance <paramref name="toplevel"/>
/// instead of creating one.
/// </summary>
/// <param name="toplevel"></param>
/// <param name="width"></param>
/// <param name="height"></param>
/// <param name="v2TestDriver"></param>
/// <returns></returns>
public static GuiTestContext A (Toplevel toplevel, int width, int height, V2TestDriver v2TestDriver)
{
return new (()=>toplevel, width, height, v2TestDriver);
}
/// <summary>
/// The global timeout to allow for any given application to run for before shutting down.
/// </summary>
public static TimeSpan Timeout { get; set; } = TimeSpan.FromSeconds (30);
}