public async Task SelectPreviousHistoryEntry(int[] linesToSelect, string selectedText, int selectedLineIndex) { var input = @"f <- function() { print(42) } g <- function() { print(7*9) } h <- function() { print(42) }"; _history.AddToHistory(input); foreach (var line in linesToSelect) { _history.SelectHistoryEntry(line); } await DoEvents(); _history.SelectPreviousHistoryEntry(); await DoEvents(); var selectedSpans = _history.GetSelectedHistoryEntrySpans(); var selectedSpan = selectedSpans.Should().ContainSingle().Which; selectedSpan.GetText().Should().Be(selectedText); var selectedTextViewLine = _historyVisualComponent.TextView.TextViewLines.GetTextViewLineContainingBufferPosition(selectedSpan.Start); selectedTextViewLine.VisibilityState.Should().Be(VisibilityState.FullyVisible); }