Example #1
0
        public void Clear()
        {
            var buffer = new ConsoleInputBuffer();

            buffer.Insert("abcd");
            buffer.MoveCursor(SeekOrigin.Begin, 2);

            buffer.Clear();

            buffer.Contents.Should().BeEmpty();
            buffer.CursorIndex.Should().Be(0);
            buffer.Length.Should().Be(0);
            buffer.CursorIsAtEnd.Should().BeTrue();
            buffer.ToString().Should().BeEmpty();
        }