コード例 #1
0
        private void Create(params string[] lines)
        {
            _textView    = EditorUtil.CreateView(lines);
            _factory     = new MockRepository(MockBehavior.Strict);
            _host        = _factory.Create <IVimHost>();
            _statusUtil  = _factory.Create <IStatusUtil>();
            _registerMap = VimUtil.CreateRegisterMap(MockObjectFactory.CreateClipboardDevice(_factory).Object);
            _vimData     = new VimData();
            var settings      = new GlobalSettings();
            var localSettings = new LocalSettings(settings, _textView);
            var motionUtil    = VimUtil.CreateTextViewMotionUtil(
                _textView,
                settings: localSettings,
                vimData: _vimData);
            var capture = new MotionCapture(
                _host.Object,
                _textView,
                MockObjectFactory.CreateIncrementalSearch(factory: _factory).Object,
                localSettings);

            _commandUtil = VimUtil.CreateCommandUtil(
                _textView,
                motionUtil: motionUtil,
                statusUtil: _statusUtil.Object,
                registerMap: _registerMap,
                vimData: _vimData);
            _runnerRaw = new CommandRunner(
                _textView,
                _registerMap,
                capture,
                _commandUtil,
                _statusUtil.Object,
                VisualKind.Character);
            _runner = _runnerRaw;
        }
コード例 #2
0
ファイル: CommandRunnerTest.cs プロジェクト: sh54/VsVim
        private void Create(params string[] lines)
        {
            _textView      = CreateTextView(lines);
            _vimTextBuffer = Vim.CreateVimTextBuffer(_textView.TextBuffer);
            _registerMap   = Vim.RegisterMap;
            var vimBufferData = CreateVimBufferData(
                _vimTextBuffer,
                _textView);

            _commandUtil = VimUtil.CreateCommandUtil(vimBufferData);
            var motionCapture = VimUtil.CreateMotionCapture(vimBufferData);

            _runnerRaw = new CommandRunner(
                _textView,
                _registerMap,
                motionCapture,
                _commandUtil,
                new StatusUtil(),
                VisualKind.Character);
            _runner = _runnerRaw;
        }