XunitContextExtensions.cs 754 B

123456789101112131415161718192021222324252627282930313233
  1. using System.Drawing;
  2. using TerminalGuiFluentTesting;
  3. using Xunit;
  4. namespace TerminalGuiFluentTestingXunit;
  5. public static partial class XunitContextExtensions
  6. {
  7. // Placeholder
  8. /// <summary>
  9. /// Asserts that the last set cursor position matches <paramref name="expected"/>
  10. /// </summary>
  11. /// <param name="context"></param>
  12. /// <param name="expected"></param>
  13. /// <returns></returns>
  14. public static GuiTestContext AssertCursorPosition (this GuiTestContext context, Point expected)
  15. {
  16. try
  17. {
  18. Assert.Equal (expected, context.GetCursorPosition ());
  19. }
  20. catch (Exception)
  21. {
  22. context.HardStop ();
  23. throw;
  24. }
  25. return context;
  26. }
  27. }