public override void UpdateCursor() { if (!EnsureCursorVisibility()) { return; } // Prevents the exception of size changing during resizing. try { if (ccol >= 0 && ccol < FakeConsole.BufferWidth && crow >= 0 && crow < FakeConsole.BufferHeight) { FakeConsole.SetCursorPosition(ccol, crow); } } catch (System.IO.IOException) { } catch (ArgumentOutOfRangeException) { } }
public void CanWriteToAnyPosition() { Console.SetCursorPosition(0, 1); Console.Write('A'); Assert.AreEqual('A', Console.BufferAt(0, 1)); }