Ejemplo n.º 1
0
 private void Create(params string[] lines)
 {
     _textView                 = CreateTextView(lines);
     _textBuffer               = _textView.TextBuffer;
     _factory                  = new MockRepository(MockBehavior.Loose);
     _operations               = _factory.Create <ICommonOperations>(MockBehavior.Strict);
     _trackerRaw               = new TextChangeTracker(_textView, _operations.Object);
     _trackerRaw.Enabled       = true;
     _tracker                  = _trackerRaw;
     _tracker.ChangeCompleted += (sender, args) => { _lastChange = args.TextChange; };
 }
Ejemplo n.º 2
0
 private void Create(params string[] lines)
 {
     _textView = CreateTextView(lines);
     _textBuffer = _textView.TextBuffer;
     _factory = new MockRepository(MockBehavior.Loose);
     _operations = _factory.Create<ICommonOperations>(MockBehavior.Strict);
     _vimTextBuffer = _factory.Create<IVimTextBuffer>(MockBehavior.Strict);
     _vimTextBuffer.SetupProperty(x => x.LastEditPoint);
     _trackerRaw = new TextChangeTracker(_vimTextBuffer.Object, _textView, _operations.Object);
     _trackerRaw.TrackCurrentChange = true;
     _tracker = _trackerRaw;
     _tracker.ChangeCompleted += (sender, args) => { _lastChange = args.TextChange; };
 }
Ejemplo n.º 3
0
 private void Create(params string[] lines)
 {
     _textView      = CreateTextView(lines);
     _textBuffer    = _textView.TextBuffer;
     _factory       = new MockRepository(MockBehavior.Loose);
     _operations    = _factory.Create <ICommonOperations>(MockBehavior.Strict);
     _vimTextBuffer = _factory.Create <IVimTextBuffer>(MockBehavior.Strict);
     _vimTextBuffer.SetupProperty(x => x.LastEditPoint);
     _trackerRaw = new TextChangeTracker(_vimTextBuffer.Object, _textView, _operations.Object);
     _trackerRaw.TrackCurrentChange = true;
     _tracker = _trackerRaw;
     _tracker.ChangeCompleted += (sender, args) => { _lastChange = args.TextChange; };
 }
Ejemplo n.º 4
0
 private void Create(params string[] lines)
 {
     _textBuffer = EditorUtil.CreateTextBuffer(lines);
     _factory    = new MockRepository(MockBehavior.Loose);
     _textCaret  = _factory.Create <ITextCaret>();
     _textView   = MockObjectFactory.CreateTextView(
         textBuffer: _textBuffer,
         caret: _textCaret.Object,
         factory: _factory);
     _textView.SetupGet(x => x.HasAggregateFocus).Returns(true);
     _localSettings            = _factory.Create <IVimLocalSettings>();
     _operations               = _factory.Create <ICommonOperations>(MockBehavior.Strict);
     _trackerRaw               = new TextChangeTracker(_textView.Object, _operations.Object);
     _trackerRaw.Enabled       = true;
     _tracker                  = _trackerRaw;
     _tracker.ChangeCompleted += (sender, data) => { _lastChange = data; };
 }
Ejemplo n.º 5
0
 protected void Create(params string[] lines)
 {
     _textBuffer = EditorUtil.CreateBuffer(lines);
     _factory    = new MockRepository(MockBehavior.Loose);
     _textCaret  = _factory.Create <ITextCaret>();
     _textView   = _factory.Create <ITextView>();
     _textView.SetupGet(x => x.Caret).Returns(_textCaret.Object);
     _textView.SetupGet(x => x.HasAggregateFocus).Returns(true);
     _mouse     = _factory.Create <IMouseDevice>();
     _keyboard  = _factory.Create <IKeyboardDevice>();
     _vimBuffer = new MockVimBuffer()
     {
         TextViewImpl   = _textView.Object,
         TextBufferImpl = _textBuffer
     };
     _trackerRaw = new TextChangeTracker(_vimBuffer, _keyboard.Object, _mouse.Object);
     _tracker    = _trackerRaw;
     _tracker.ChangeCompleted += (sender, data) => { _lastChange = data; };
 }
Ejemplo n.º 6
0
 private void Create(params string[] lines)
 {
     _textView   = CreateTextView(lines);
     _textBuffer = _textView.TextBuffer;
     _factory    = new MockRepository(MockBehavior.Loose);
     _operations = _factory.Create <ICommonOperations>(MockBehavior.Strict);
     _operations.Setup(x => x.RecordLastChange(It.IsAny <SnapshotSpan>(), It.IsAny <SnapshotSpan>()));
     _operations.Setup(x => x.RecordLastYank(It.IsAny <SnapshotSpan>()));
     _vimTextBuffer = _factory.Create <IVimTextBuffer>(MockBehavior.Strict);
     _vimTextBuffer.SetupProperty(x => x.LastEditPoint);
     _vimTextBuffer.SetupProperty(x => x.LastChangeOrYankStart);
     _vimTextBuffer.SetupProperty(x => x.LastChangeOrYankEnd);
     _trackerRaw = new TextChangeTracker(_vimTextBuffer.Object, _textView, _operations.Object)
     {
         TrackCurrentChange = true
     };
     _tracker = _trackerRaw;
     _tracker.ChangeCompleted += (sender, args) => { _lastChange = args.TextChange; };
 }
Ejemplo n.º 7
0
 protected void Create(params string[] lines)
 {
     _textBuffer = EditorUtil.CreateBuffer(lines);
     _factory = new MockRepository(MockBehavior.Loose);
     _textCaret = _factory.Create<ITextCaret>();
     _textView = _factory.Create<ITextView>();
     _textView.SetupGet(x => x.Caret).Returns(_textCaret.Object);
     _textView.SetupGet(x => x.HasAggregateFocus).Returns(true);
     _mouse = _factory.Create<IMouseDevice>();
     _keyboard = _factory.Create<IKeyboardDevice>();
     _vimBuffer = new MockVimBuffer()
     {
         TextViewImpl = _textView.Object,
         TextBufferImpl = _textBuffer
     };
     _trackerRaw = new TextChangeTracker(_vimBuffer, _keyboard.Object, _mouse.Object);
     _tracker = _trackerRaw;
     _tracker.ChangeCompleted += (sender, data) => { _lastChange = data; };
 }
Ejemplo n.º 8
0
 private void Create(params string[] lines)
 {
     _textView = CreateTextView(lines);
     _textBuffer = _textView.TextBuffer;
     _factory = new MockRepository(MockBehavior.Loose);
     _operations = _factory.Create<ICommonOperations>(MockBehavior.Strict);
     _trackerRaw = new TextChangeTracker(_textView, _operations.Object);
     _trackerRaw.Enabled = true;
     _tracker = _trackerRaw;
     _tracker.ChangeCompleted += (sender, args) => { _lastChange = args.TextChange; };
 }
Ejemplo n.º 9
0
 protected void Create(params string[] lines)
 {
     _textBuffer = EditorUtil.CreateTextBuffer(lines);
     _factory = new MockRepository(MockBehavior.Loose);
     _textCaret = _factory.Create<ITextCaret>();
     _textView = MockObjectFactory.CreateTextView(
         textBuffer: _textBuffer,
         caret: _textCaret.Object,
         factory: _factory);
     _textView.SetupGet(x => x.HasAggregateFocus).Returns(true);
     _localSettings = _factory.Create<IVimLocalSettings>();
     _mouse = _factory.Create<IMouseDevice>();
     _keyboard = _factory.Create<IKeyboardDevice>();
     _buffer = MockObjectFactory.CreateVimBuffer(
         textView: _textView.Object,
         settings: _localSettings.Object,
         factory: _factory);
     _operations = _factory.Create<ICommonOperations>(MockBehavior.Strict);
     _trackerRaw = new TextChangeTracker(_buffer.Object, _operations.Object, _keyboard.Object, _mouse.Object);
     _tracker = _trackerRaw;
     _tracker.ChangeCompleted += (sender, data) => { _lastChange = data; };
 }