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>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using TerminalGuiFluentTesting;
|
||||
using System.Drawing;
|
||||
using TerminalGuiFluentTesting;
|
||||
using Xunit;
|
||||
|
||||
namespace TerminalGuiFluentTestingXunit;
|
||||
@@ -6,4 +7,27 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user