public void Init() { IDocument doc = MockTextMarkerService.CreateDocumentWithMockService(); markerService = doc.GetRequiredService<ITextMarkerService>(); // Add xpath marker to document. doc.Text = "<Test/>"; XPathNodeTextMarker xpathNodeMarker = new XPathNodeTextMarker(doc); XPathNodeMatch nodeMatch = new XPathNodeMatch("Test", "<Test/>", 0, 1, XPathNodeType.Element); xpathNodeMarker.AddMarker(nodeMatch); // Add non text editor provider view to workbench. workbench = MockRepository.GenerateStrictMock<IWorkbench>(); workbench.Stub(w => w.ViewContentCollection).Return(new List<IViewContent>()); nonTextEditorProviderView = new MockViewContent(); workbench.ViewContentCollection.Add(nonTextEditorProviderView); // Add document to view content. textEditorView = new MockTextEditorProviderViewContent(); textEditorView.MockTextEditor.SetDocument(doc); workbench.ViewContentCollection.Add(textEditorView); command = new RemoveXPathHighlightingCommand(workbench); }
public void Init() { IDocument doc = MockTextMarkerService.CreateDocumentWithMockService(); markerService = doc.GetRequiredService <ITextMarkerService>(); // Add xpath marker to document. doc.Text = "<Test/>"; XPathNodeTextMarker xpathNodeMarker = new XPathNodeTextMarker(doc); XPathNodeMatch nodeMatch = new XPathNodeMatch("Test", "<Test/>", 0, 1, XPathNodeType.Element); xpathNodeMarker.AddMarker(nodeMatch); // Add non text editor provider view to workbench. workbench = MockRepository.GenerateStrictMock <IWorkbench>(); workbench.Stub(w => w.ViewContentCollection).Return(new List <IViewContent>()); nonTextEditorProviderView = new MockViewContent(); workbench.ViewContentCollection.Add(nonTextEditorProviderView); // Add document to view content. textEditorView = new MockTextEditorProviderViewContent(); textEditorView.MockTextEditor.SetDocument(doc); workbench.ViewContentCollection.Add(textEditorView); command = new RemoveXPathHighlightingCommand(workbench); }