public void AddToHistory(string[] inputs, string expected) { var history = new RHistory(_interactiveWorkflow, _textBuffer, null, new RSettingsStub(), null, null, () => { }); foreach (var input in inputs) { history.AddToHistory(input); } _textBuffer.CurrentSnapshot.GetText().Should().Be(expected); }
public void Search(string[] entries, string entryStart, bool isMultiline, string[] expected) { var settings = new RSettingsStub { MultilineHistorySelection = isMultiline }; var history = new RHistory(_interactiveWorkflow, _textBuffer, null, settings, null, null, () => { }); foreach (var entry in entries) { history.AddToHistory(entry); } history.Search(entryStart).Should().Equal(expected); }
public void SelectHistoryEntry(bool isMultiline, string[] inputs, int lineToSelect, string expected) { var settings = new RSettingsStub { MultilineHistorySelection = isMultiline }; var history = new RHistory(_interactiveWorkflow, _textBuffer, null, settings, null, null, () => { }); foreach (var input in inputs) { history.AddToHistory(input); } history.SelectHistoryEntry(lineToSelect); history.GetSelectedText().Should().Be(expected); history.GetSelectedHistoryEntrySpans().Should().ContainSingle() .Which.GetText().Should().Be(expected); }