public static void WriteInput(this OffscreenBuffer offscreenBuffer, TextInputBuffer textInputBuffer)
        {
            offscreenBuffer.Write(textInputBuffer.ToBackwardString());

            offscreenBuffer.PushCursor();

            offscreenBuffer.Write(textInputBuffer.ToForwardString());
        }
        public void MoveBackward(string value, string backward, string forward)
        {
            var textInputBuffer = new TextInputBuffer();

            foreach (var c in value)
            {
                textInputBuffer.Insert(c);
            }

            textInputBuffer.MoveBackward();

            Assert.Equal(backward, textInputBuffer.ToBackwardString());
            Assert.Equal(forward, textInputBuffer.ToForwardString());
        }
        public void Backspace(string value, string substring)
        {
            var textInputBuffer = new TextInputBuffer();

            foreach (var c in value)
            {
                textInputBuffer.Insert(c);
            }

            textInputBuffer.Backspace();

            Assert.Equal(substring, textInputBuffer.ToString());
            Assert.Equal(substring, textInputBuffer.ToBackwardString());
            Assert.Equal(string.Empty, textInputBuffer.ToForwardString());
        }
        public void Delete(string value, string substring)
        {
            var textInputBuffer = new TextInputBuffer();

            foreach (var c in value)
            {
                textInputBuffer.Insert(c);
            }

            while (!textInputBuffer.IsStart)
            {
                textInputBuffer.MoveBackward();
            }

            textInputBuffer.Delete();

            Assert.Equal(substring, textInputBuffer.ToString());
            Assert.Equal(string.Empty, textInputBuffer.ToBackwardString());
            Assert.Equal(substring, textInputBuffer.ToForwardString());
        }