public static async Task AugmentQuickInfoSessionReturnsNoContentOrApplicableSpanWhenBufferIsEmpty() { var buffer = new FakeTextBuffer(string.Empty); var session = new FakeQuickInfoSession(); using (var source = new TemplateQuickInfoSource(buffer)) { var result = await source.GetQuickInfoItemAsync(session, CancellationToken.None); Assert.Null(result?.ApplicableToSpan); } }
public static void AugmentQuickInfoSessionReturnsDescriptionOfSyntaxNodeAtTriggerPoint() { var buffer = new FakeTextBuffer("<#@ assembly name=\"System\" #>"); var session = new FakeQuickInfoSession { SnapshotTriggerPoint = new SnapshotPoint(buffer.CurrentSnapshot, 5) }; using (var source = new TemplateQuickInfoSource(buffer)) { var quickInfoContent = new List<object>(); ITrackingSpan applicableToSpan; source.AugmentQuickInfoSession(session, quickInfoContent, out applicableToSpan); Assert.Contains("assembly", (string)quickInfoContent[0], StringComparison.Ordinal); } }
public static void AugmentQuickInfoSessionReturnsNoContentOrApplicableSpanWhenBufferContainsTemplateThatCouldNotBeParsed() { var buffer = new FakeTextBuffer("<#"); var session = new FakeQuickInfoSession { SnapshotTriggerPoint = new SnapshotPoint(buffer.CurrentSnapshot, 1) }; using (var source = new TemplateQuickInfoSource(buffer)) { var quickInfoContent = new List<object>(); ITrackingSpan applicableToSpan; source.AugmentQuickInfoSession(session, quickInfoContent, out applicableToSpan); Assert.Equal(0, quickInfoContent.Count); Assert.Null(applicableToSpan); } }
public static void AugmentQuickInfoSessionReturnsNoContentOrApplicableSpanSyntaxNodeAtTriggerPointHasNoDescription() { var buffer = new FakeTextBuffer("<# code #>"); var session = new FakeQuickInfoSession { SnapshotTriggerPoint = new SnapshotPoint(buffer.CurrentSnapshot, 3) }; using (var source = new TemplateQuickInfoSource(buffer)) { var quickInfoContent = new List<object>(); ITrackingSpan applicableToSpan; source.AugmentQuickInfoSession(session, quickInfoContent, out applicableToSpan); Assert.Equal(0, quickInfoContent.Count); Assert.Null(applicableToSpan); } }
public static void AugmentQuickInfoSessionReturnsNoContentOrApplicableSpanWhenBufferIsEmpty() { var buffer = new FakeTextBuffer(string.Empty); var session = new FakeQuickInfoSession(); using (var source = new TemplateQuickInfoSource(buffer)) { var quickInfoContent = new List<object>(); ITrackingSpan applicableToSpan; source.AugmentQuickInfoSession(session, quickInfoContent, out applicableToSpan); Assert.Equal(0, quickInfoContent.Count); Assert.Null(applicableToSpan); } }
public static async Task AugmentQuickInfoSessionReturnsSpanOfSyntaxNodeProvidingDescription() { var buffer = new FakeTextBuffer("<#@ assembly name=\"System\" #>"); var session = new FakeQuickInfoSession { SnapshotTriggerPoint = new SnapshotPoint(buffer.CurrentSnapshot, 15) }; using (var source = new TemplateQuickInfoSource(buffer)) { var result = await source.GetQuickInfoItemAsync(session, CancellationToken.None); Assert.Equal(new Span(13, 13), result.ApplicableToSpan.GetSpan(buffer.CurrentSnapshot).Span); } }
public static async Task AugmentQuickInfoSessionReturnsDescriptionOfSyntaxNodeAtTriggerPoint() { var buffer = new FakeTextBuffer("<#@ assembly name=\"System\" #>"); var session = new FakeQuickInfoSession { SnapshotTriggerPoint = new SnapshotPoint(buffer.CurrentSnapshot, 5) }; using (var source = new TemplateQuickInfoSource(buffer)) { var result = await source.GetQuickInfoItemAsync(session, CancellationToken.None); Assert.Contains("assembly", (string)result.Item, StringComparison.Ordinal); } }
public static async Task AugmentQuickInfoSessionReturnsNoContentOrApplicableSpanWhenBufferContainsTemplateThatCouldNotBeParsed() { var buffer = new FakeTextBuffer("<#"); var session = new FakeQuickInfoSession { SnapshotTriggerPoint = new SnapshotPoint(buffer.CurrentSnapshot, 1) }; using (var source = new TemplateQuickInfoSource(buffer)) { var result = await source.GetQuickInfoItemAsync(session, CancellationToken.None); Assert.Null(result?.ApplicableToSpan); } }
public static async Task AugmentQuickInfoSessionReturnsNoContentOrApplicableSpanSyntaxNodeAtTriggerPointHasNoDescription() { var buffer = new FakeTextBuffer("<# code #>"); var session = new FakeQuickInfoSession { SnapshotTriggerPoint = new SnapshotPoint(buffer.CurrentSnapshot, 3) }; using (var source = new TemplateQuickInfoSource(buffer)) { var result = await source.GetQuickInfoItemAsync(session, CancellationToken.None); Assert.Null(result?.ApplicableToSpan); } }
public static void AugmentQuickInfoSessionReturnsNoContentOrApplicableSpanWhenBufferIsEmpty() { var buffer = new FakeTextBuffer(string.Empty); var session = new FakeQuickInfoSession(); using (var source = new TemplateQuickInfoSource(buffer)) { var quickInfoContent = new List <object>(); ITrackingSpan applicableToSpan; source.AugmentQuickInfoSession(session, quickInfoContent, out applicableToSpan); Assert.Equal(0, quickInfoContent.Count); Assert.Null(applicableToSpan); } }
public static void AugmentQuickInfoSessionReturnsSpanOfSyntaxNodeProvidingDescription() { var buffer = new FakeTextBuffer("<#@ assembly name=\"System\" #>"); var session = new FakeQuickInfoSession { SnapshotTriggerPoint = new SnapshotPoint(buffer.CurrentSnapshot, 15) }; using (var source = new TemplateQuickInfoSource(buffer)) { var quickInfoContent = new List <object>(); ITrackingSpan applicableToSpan; source.AugmentQuickInfoSession(session, quickInfoContent, out applicableToSpan); Assert.Equal(new Span(13, 13), applicableToSpan.GetSpan(buffer.CurrentSnapshot).Span); } }
public static void AugmentQuickInfoSessionReturnsDescriptionOfSyntaxNodeAtTriggerPoint() { var buffer = new FakeTextBuffer("<#@ assembly name=\"System\" #>"); var session = new FakeQuickInfoSession { SnapshotTriggerPoint = new SnapshotPoint(buffer.CurrentSnapshot, 5) }; using (var source = new TemplateQuickInfoSource(buffer)) { var quickInfoContent = new List <object>(); ITrackingSpan applicableToSpan; source.AugmentQuickInfoSession(session, quickInfoContent, out applicableToSpan); Assert.Contains("assembly", (string)quickInfoContent[0], StringComparison.Ordinal); } }
public static void AugmentQuickInfoSessionReturnsNoContentOrApplicableSpanWhenBufferContainsTemplateThatCouldNotBeParsed() { var buffer = new FakeTextBuffer("<#"); var session = new FakeQuickInfoSession { SnapshotTriggerPoint = new SnapshotPoint(buffer.CurrentSnapshot, 1) }; using (var source = new TemplateQuickInfoSource(buffer)) { var quickInfoContent = new List <object>(); ITrackingSpan applicableToSpan; source.AugmentQuickInfoSession(session, quickInfoContent, out applicableToSpan); Assert.Equal(0, quickInfoContent.Count); Assert.Null(applicableToSpan); } }
public static void AugmentQuickInfoSessionReturnsNoContentOrApplicableSpanSyntaxNodeAtTriggerPointHasNoDescription() { var buffer = new FakeTextBuffer("<# code #>"); var session = new FakeQuickInfoSession { SnapshotTriggerPoint = new SnapshotPoint(buffer.CurrentSnapshot, 3) }; using (var source = new TemplateQuickInfoSource(buffer)) { var quickInfoContent = new List <object>(); ITrackingSpan applicableToSpan; source.AugmentQuickInfoSession(session, quickInfoContent, out applicableToSpan); Assert.Equal(0, quickInfoContent.Count); Assert.Null(applicableToSpan); } }
public static void AugmentQuickInfoSessionReturnsSpanOfSyntaxNodeProvidingDescription() { var buffer = new FakeTextBuffer("<#@ assembly name=\"System\" #>"); var session = new FakeQuickInfoSession { SnapshotTriggerPoint = new SnapshotPoint(buffer.CurrentSnapshot, 15) }; using (var source = new TemplateQuickInfoSource(buffer)) { var quickInfoContent = new List<object>(); ITrackingSpan applicableToSpan; source.AugmentQuickInfoSession(session, quickInfoContent, out applicableToSpan); Assert.Equal(new Span(13, 13), applicableToSpan.GetSpan(buffer.CurrentSnapshot).Span); } }