Example #1
0
        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);
        }
Example #2
0
        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);
        }