public SelectionChangeTrackerTest()
        {
            _factory   = new MockRepository(MockBehavior.Loose);
            _selection = _factory.Create <ITextSelection>();
            _textView  = MockObjectFactory.CreateTextView(
                selection: _selection.Object,
                factory: _factory);
            _vimHost = _factory.Create <IVimHost>();
            _vimHost.Setup(x => x.IsFocused(_textView.Object)).Returns(true);
            _vimBuffer = MockObjectFactory.CreateVimBuffer(
                textView: _textView.Object,
                vim: MockObjectFactory.CreateVim(host: _vimHost.Object).Object,
                factory: _factory);
            _vimBuffer.SetupGet(x => x.IsClosed).Returns(false);

            _mouseDevice       = _factory.Create <IMouseDevice>();
            _selectionOverride = _factory.Create <IVisualModeSelectionOverride>();
            _selectionOverride.Setup(x => x.IsInsertModePreferred(It.IsAny <ITextView>())).Returns(false);
            var selectionList = new List <IVisualModeSelectionOverride>();

            selectionList.Add(_selectionOverride.Object);

            _context = new TestableSynchronizationContext();
            _context.Install();
            _tracker = new SelectionChangeTracker(_vimBuffer.Object, _factory.Create <ICommonOperations>(MockBehavior.Loose).Object, selectionList.ToFSharpList(), _mouseDevice.Object);
        }
        public SelectionChangeTrackerTest()
        {
            _factory = new MockRepository(MockBehavior.Loose);
            _selection = _factory.Create<ITextSelection>();
            _textView = MockObjectFactory.CreateTextView(
                selection: _selection.Object,
                factory: _factory);
            _vimHost = _factory.Create<IVimHost>();
            _vimHost.Setup(x => x.IsFocused(_textView.Object)).Returns(true);
            _vimBuffer = MockObjectFactory.CreateVimBuffer(
                textView: _textView.Object,
                vim: MockObjectFactory.CreateVim(host: _vimHost.Object).Object,
                factory: _factory);
            _vimBuffer.SetupGet(x => x.IsClosed).Returns(false);

            _mouseDevice = _factory.Create<IMouseDevice>();
            _selectionOverride = _factory.Create<IVisualModeSelectionOverride>();
            _selectionOverride.Setup(x => x.IsInsertModePreferred(It.IsAny<ITextView>())).Returns(false);
            var selectionList = new List<IVisualModeSelectionOverride>();
            selectionList.Add(_selectionOverride.Object);

            _context = new TestableSynchronizationContext();
            _context.Install();
            _tracker = new SelectionChangeTracker(_vimBuffer.Object, _factory.Create<ICommonOperations>(MockBehavior.Loose).Object, selectionList.ToFSharpList(), _mouseDevice.Object);
        }
 protected 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;
     _context = new TestableSynchronizationContext();
     _context.Install();
 }
 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;
     _context       = new TestableSynchronizationContext();
     _context.Install();
 }
 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;
     _context = new TestableSynchronizationContext();
     _context.Install();
     _testableMouseDevice = (TestableMouseDevice)MouseDevice;
     _testableMouseDevice.IsLeftButtonPressed = true;
 }
        public SelectionChangeTrackerTest()
        {
            _factory = new MockRepository(MockBehavior.Loose);
            _selection = _factory.Create<ITextSelection>();
            _textView = MockObjectFactory.CreateTextView(
                selection: _selection.Object,
                factory: _factory);
            _vimBuffer = MockObjectFactory.CreateVimBuffer(
                textView: _textView.Object,
                factory: _factory);

            _selectionOverride = _factory.Create<IVisualModeSelectionOverride>();
            _selectionOverride.Setup(x => x.IsInsertModePreferred(It.IsAny<ITextView>())).Returns(false);
            var selectionList = new List<IVisualModeSelectionOverride>();
            selectionList.Add(_selectionOverride.Object);

            _context = new TestableSynchronizationContext();
            _context.Install();
            _tracker = new SelectionChangeTracker(_vimBuffer.Object, selectionList.ToFSharpList());
        }
Exemple #7
0
        public SelectionChangeTrackerTest()
        {
            _factory   = new MockRepository(MockBehavior.Loose);
            _selection = _factory.Create <ITextSelection>();
            _textView  = MockObjectFactory.CreateTextView(
                selection: _selection.Object,
                factory: _factory);
            _vimBuffer = MockObjectFactory.CreateVimBuffer(
                textView: _textView.Object,
                factory: _factory);

            _selectionOverride = _factory.Create <IVisualModeSelectionOverride>();
            _selectionOverride.Setup(x => x.IsInsertModePreferred(It.IsAny <ITextView>())).Returns(false);
            var selectionList = new List <IVisualModeSelectionOverride>();

            selectionList.Add(_selectionOverride.Object);

            _context = new TestableSynchronizationContext();
            _context.Install();
            _tracker = new SelectionChangeTracker(_vimBuffer.Object, selectionList.ToFSharpList());
        }
Exemple #8
0
 public SelectionTrackerTest()
 {
     _context = new TestableSynchronizationContext();
     _context.Install();
 }