public static StubWpfTextView CreateTextView(StubIdeScope ideScope, TestText inputText, string newLine = null, IProjectScope projectScope = null, string contentType = "deveroom", string filePath = null)
        {
            var textBuffer = VsxStubObjects.CreateTextBuffer(inputText.ToString(newLine));

            textBuffer.Properties.AddProperty(typeof(IProjectScope), projectScope);
            if (filePath != null)
            {
                textBuffer.Properties.AddProperty(typeof(IVsTextBuffer), new FilePathProvider(filePath));
            }
            var textView = new StubWpfTextView(textBuffer);

            if (contentType == "deveroom")
            {
                var tagAggregator = new StubBufferTagAggregatorFactoryService(ideScope).CreateTagAggregator <DeveroomTag>(textView.TextBuffer);
                tagAggregator.GetTags(new SnapshotSpan(textView.TextSnapshot, 0, textView.TextSnapshot.Length)).ToArray();
            }

            inputText.SetSelection(textView);
            inputText.SetCaret(textView);

            return(textView);
        }
Beispiel #2
0
 public StubBufferTagAggregatorFactoryService(StubIdeScope ideScope)
 {
     _ideScope = ideScope;
 }
Beispiel #3
0
 public FormatTableCommandTests(ITestOutputHelper testOutputHelper)
 {
     _testOutputHelper = testOutputHelper;
     _ideScope         = new StubIdeScope(testOutputHelper);
 }
 public DeveroomSteps(ITestOutputHelper outputHelper, StubIdeScope stubIdeScope)
 {
     _outputHelper = outputHelper;
     _stubIdeScope = stubIdeScope;
 }
Beispiel #5
0
 public ProjectSystemSteps(StubIdeScope stubIdeScope)
 {
     _ideScope = stubIdeScope;
 }