public void Virtual(string line1) { Create(line1, ""); var point1 = _textBuffer.GetVirtualPointInLine(0, 0); var point2 = _textBuffer.GetVirtualPointInLine(0, 4); var span = new VirtualSnapshotSpan(point1, point2); _textView.Selection.Select(point1, point2); DoEvents(); var visualSpan = VisualSpan.CreateForVirtualSelection(_textView, VisualKind.Character, tabStop: 4, useVirtualSpace: true); Assert.Equal(point1, visualSpan.AsCharacter().CharacterSpan.VirtualStart); Assert.Equal(point2, visualSpan.AsCharacter().CharacterSpan.VirtualEnd); Assert.Equal(span.Length, visualSpan.AsCharacter().CharacterSpan.VirtualLength); }