mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* 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>
34 lines
754 B
C#
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;
|
|
}
|
|
}
|