Files
Terminal.Gui/TerminalGuiFluentTesting/With.cs
Thomas Nind eaa9ee1ef6 Fixes #4022 file dialog tests and bugfix for cancellation (#4024)
* Add class for detecting information about console in extensible way

* WIP - Create test for reordering

* Change Dictionary to List and preserve TreeBuilder order

* Add test to ensure branch expansion/status remains consistent despite reorder

* Cleanup code

* Fix regression when removed child was the selected one

* Revert "Add class for detecting information about console in extensible way"

This reverts commit 7e4253cf28.

* Code cleanup and enable nullable on Branch

* Remove color scheme and driver from Branch draw

* Add xunit context extensions

* Investigate codegen for xunit

* Getting closer to something that works

* Fix code generation

* Further explore code gen

* Generate all methods in single class for easier extensibility

* Simplify code gen by moving parameter creation to its own method

* Implement asserts A-I

* Add remaining assert calls that are not obsolete

* Fix unit test

* Roll back versions to be compatible with CI version of csharp

* Handle params and ref etc

* Fix null warning

* WIP - start to add integration tests for FileDialog

* Add ability to tab focus to specific control with simple one line delegate

* Clarify test criteria

* Add unit tests for Ok and other ways of canceling dialog

* Fix other buttons also triggering save

* Fix for linux environment tests

* Fix for linux again

* Fix application null race condition - add better way of knowing if stuff is finished

* Better fix for shutdown detection

* Add test that shows #4026 is not an issue

* Switch to `_fileSystem.Directory.GetLogicalDrives ()`

* Don't show duplicate MyDocuments etc
2025-05-29 14:08:47 -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);
}