AddToHistory() public méthode

public AddToHistory ( string text ) : void
text string
Résultat void
Exemple #1
0
        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);
        }
Exemple #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);
        }