Files
Terminal.Gui/Tests/TerminalGuiFluentTestingXunit/XunitContextExtensions.cs
Thomas Nind ee8f9a8e45 Fixes #4076 cursor text field (#4077)
* Add test for TextField cursor position

* Add comment and one more assert

* Fix cursor position at the end

* Remove unused local field

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
2025-05-11 16:29:22 -06:00

34 lines
754 B
C#

using System.Drawing;
using TerminalGuiFluentTesting;
using Xunit;
namespace TerminalGuiFluentTestingXunit;
public static partial class XunitContextExtensions
{
// Placeholder
/// <summary>
/// Asserts that the last set cursor position matches <paramref name="expected"/>
/// </summary>
/// <param name="context"></param>
/// <param name="expected"></param>
/// <returns></returns>
public static GuiTestContext AssertCursorPosition (this GuiTestContext context, Point expected)
{
try
{
Assert.Equal (expected, context.GetCursorPosition ());
}
catch (Exception)
{
context.HardStop ();
throw;
}
return context;
}
}