Exemplo n.º 1
0
 public void CreateBuffer(params string[] lines)
 {
     var tuple = Utils.EditorUtil.CreateViewAndOperations(lines);
     m_view = tuple.Item1;
     var service = EditorUtil.FactoryService;
     m_buffer = service.vim.CreateBuffer(m_view);
     m_host = (FakeVimHost)service.vim.Host;
 }
Exemplo n.º 2
0
 public void Create(params string[] lines)
 {
     _view = Utils.EditorUtil.CreateView(lines);
     _view.Caret.MoveTo(new SnapshotPoint(_view.TextSnapshot, 0));
     _map = new RegisterMap();
     _host = new FakeVimHost();
     _editOpts = new Mock<IEditorOperations>(MockBehavior.Strict);
     _operations = new Mock<IOperations>(MockBehavior.Strict);
     _bufferData = MockObjectFactory.CreateVimBuffer(
         _view,
         "test",
         MockObjectFactory.CreateVim(_map, host: _host).Object,
         _editOpts.Object);
     _processorRaw = new Vim.Modes.Command.CommandProcessor(_bufferData.Object, _operations.Object);
     _processor = _processorRaw;
 }
Exemplo n.º 3
0
 public void PreventInput1()
 {
     var host = new FakeVimHost();
     Create2(host:host,lines:"foo");
     var input = InputUtil.CharToKeyInput(',');
     Assert.IsFalse(_mode.Commands.Any(x => x.Char == input.Char));
     Assert.IsTrue(_mode.CanProcess(input));
     var ret = _mode.Process(input);
     Assert.IsTrue(ret.IsProcessed);
     Assert.AreEqual(1, host.BeepCount);
 }
Exemplo n.º 4
0
        public void SetUp()
        {
            _caret = MockObjectFactory.CreateCaret();
            _caret.SetupProperty(x => x.IsHidden);
            _view = new Mock<IWpfTextView>(MockBehavior.Strict);
            _view.SetupGet(x => x.Caret).Returns(_caret.Object);

            _host = new FakeVimHost();
            _bufferData = MockObjectFactory.CreateVimBuffer(view:_view.Object);
            _bufferData.SetupGet(x => x.VimHost).Returns(_host);
            _processor = new Mock<ICommandProcessor>(MockBehavior.Strict);
            _modeRaw = new CommandMode(Tuple.Create(_bufferData.Object, _processor.Object));
            _mode = _modeRaw;
        }