Exemple #1
0
 protected virtual void Create(params string[] lines)
 {
     _vimBuffer      = CreateVimBuffer(lines);
     _textView       = _vimBuffer.TextView;
     _textBuffer     = _vimBuffer.TextBuffer;
     _globalSettings = _vimBuffer.GlobalSettings;
     _globalSettings.SelectModeOptions = SelectModeOptions.Mouse | SelectModeOptions.Keyboard;
     _textSelection       = _textView.Selection;
     _testableMouseDevice = (TestableMouseDevice)MouseDevice;
     _testableMouseDevice.IsLeftButtonPressed = true;
 }
 protected VimMouseProcessorTest()
 {
     _vimBuffer      = CreateVimBuffer("cat", "");
     _keyboardDevice = new Mock <IKeyboardDevice>(MockBehavior.Loose);
     _keyboardDevice.SetupGet(x => x.KeyModifiers).Returns(VimKeyModifiers.None);
     _vimMouseProcessor   = new VimMouseProcessor(_vimBuffer, _keyboardDevice.Object);
     _textView            = _vimBuffer.TextView;
     _testableMouseDevice = (TestableMouseDevice)MouseDevice;
     _testableMouseDevice.IsLeftButtonPressed = false;
     _testableMouseDevice.Point = null;
 }
        protected virtual void Create(params string[] lines)
        {
            _textView                    = CreateTextView(lines);
            _textBuffer                  = _textView.TextBuffer;
            _mockMultiSelectionUtil      = new MockSelectionUtil(_textView, isMultiSelectionSupported: true);
            VimHost.TryCustomProcessFunc = (_, command) => _mockMultiSelectionUtil.TryCustomProcess(command);
            var vimBufferData = CreateVimBufferData(_textView, null, null, null, null, _mockMultiSelectionUtil);

            _vimBuffer      = Vim.CreateVimBufferWithData(vimBufferData);
            _localSettings  = _vimBuffer.LocalSettings;
            _globalSettings = _localSettings.GlobalSettings;
            _windowSettings = _vimBuffer.WindowSettings;
            _selectionUtil  = _vimBuffer.VimBufferData.SelectionUtil;

            _testableMouseDevice = (TestableMouseDevice)MouseDevice;
            _testableMouseDevice.IsLeftButtonPressed = false;
            _testableMouseDevice.Point = null;
        }