protected virtual void Create(params string[] lines) { _factory = new MockRepository(MockBehavior.Strict); _marginControl = new CommandMarginControl(); _marginControl.CommandLineTextBox.Text = string.Empty; _vimBuffer = CreateVimBuffer(lines); _textBuffer = _vimBuffer.TextBuffer; _textView = _vimBuffer.TextView; _keyboardDevice = new MockKeyboardDevice(); _clipboardDevice = (TestableClipboardDevice)CompositionContainer.GetExportedValue <IClipboardDevice>(); var parentVisualElement = _factory.Create <FrameworkElement>(); _controller = new CommandMarginController( _vimBuffer, parentVisualElement.Object, _marginControl, VimEditorHost.EditorFormatMapService.GetEditorFormatMap(_vimBuffer.TextView), VimEditorHost.ClassificationFormatMapService.GetClassificationFormatMap(_vimBuffer.TextView), CommonOperationsFactory.GetCommonOperations(_vimBuffer.VimBufferData), _clipboardDevice); }
protected override VimKeyProcessor CreateKeyProcessor() { _factory = new MockRepository(MockBehavior.Strict); _wpfTextView = CreateTextView(); _mockAdapter = new MockAdapter(); _editorAdaptersFactoryService = _factory.Create <IVsEditorAdaptersFactoryService>(); _editorAdaptersFactoryService.Setup(x => x.GetViewAdapter(_wpfTextView)).Returns(_mockAdapter); _vsAdapter = _factory.Create <IVsAdapter>(); _vsAdapter.Setup(x => x.IsIncrementalSearchActive(It.IsAny <ITextView>())).Returns(false); _vsAdapter.SetupGet(x => x.EditorAdapter).Returns(_editorAdaptersFactoryService.Object); _vsAdapter.Setup(x => x.IsReadOnly(_wpfTextView)).Returns(false); _reportDesignerUtil = _factory.Create <IReportDesignerUtil>(); _reportDesignerUtil.Setup(x => x.IsExpressionView(_wpfTextView)).Returns(false); _mockVimBuffer = MockObjectFactory.CreateVimBuffer(_wpfTextView); _mockVimBuffer.Setup(x => x.CanProcess(It.IsAny <KeyInput>())).Returns(true); _mockVimBuffer.Setup(x => x.Process(It.IsAny <KeyInput>())).Returns(ProcessResult.NewHandled(ModeSwitch.NoSwitch)); _mockVimBuffer.SetupGet(x => x.ModeKind).Returns(ModeKind.Normal); _bufferCoordinator = new VimBufferCoordinator(_mockVimBuffer.Object); _device = new MockKeyboardDevice(); return(new VsKeyProcessor(_vsAdapter.Object, _bufferCoordinator, KeyUtil, _reportDesignerUtil.Object)); }
protected virtual void Create(params string[] lines) { _factory = new MockRepository(MockBehavior.Strict); _marginControl = new CommandMarginControl(); _marginControl.StatusLine = String.Empty; _vimBuffer = CreateVimBuffer(lines); _textBuffer = _vimBuffer.TextBuffer; _textView = _vimBuffer.TextView; _keyboardDevice = new MockKeyboardDevice(); var editorFormatMap = _factory.Create <IEditorFormatMap>(MockBehavior.Loose); editorFormatMap.Setup(x => x.GetProperties(It.IsAny <string>())).Returns(new ResourceDictionary()); var parentVisualElement = _factory.Create <FrameworkElement>(); _controller = new CommandMarginController( _vimBuffer, parentVisualElement.Object, _marginControl, editorFormatMap.Object, new List <Lazy <IOptionsProviderFactory> >()); }
public IntellisenseWindowTest(ReplServicesFixture replServicesFixture) { this.replServices = replServicesFixture.ReplServices; this.keyboard = new MockKeyboardDevice(); }