public static void CreateTaggerThrowsArgumentNullExceptionWhenBufferIsNullToFailFast()
        {
            var provider = new TemplateQuickInfoSourceProvider(Substitute.For <ITemplateEditorOptions>());
            var e        = Assert.Throws <ArgumentNullException>(() => provider.TryCreateQuickInfoSource(null));

            Assert.Equal("buffer", e.ParamName);
        }
        public static void TryCreateQuickInfoSourceReturnsNullWhenQuickInfoTooltipsAreDisabled()
        {
            ITemplateEditorOptions options = OptionsWithQuickInfoTooltipsEnabled(false);
            var provider = new TemplateQuickInfoSourceProvider(options);

            Assert.Null(provider.TryCreateQuickInfoSource(new FakeTextBuffer(string.Empty)));
        }
        public static void TryCreateQuickInfoSourceReturnsTemplateQuickInfoSource()
        {
            ITemplateEditorOptions options = OptionsWithQuickInfoTooltipsEnabled(true);
            var provider   = new TemplateQuickInfoSourceProvider(options);
            var textBuffer = new FakeTextBuffer(string.Empty);
            IQuickInfoSource quickInfoSource = provider.TryCreateQuickInfoSource(textBuffer);

            Assert.Equal(typeof(TemplateQuickInfoSource), quickInfoSource.GetType());
        }
        public static void TryCreateQuickInfoSourceReturnsSameObjectWhenCalledMultipleTimesForSameBuffer()
        {
            ITemplateEditorOptions options = OptionsWithQuickInfoTooltipsEnabled(true);
            var provider             = new TemplateQuickInfoSourceProvider(options);
            var textBuffer           = new FakeTextBuffer(string.Empty);
            IQuickInfoSource source1 = provider.TryCreateQuickInfoSource(textBuffer);
            IQuickInfoSource source2 = provider.TryCreateQuickInfoSource(textBuffer);

            Assert.Same(source1, source2);
        }
 public static void TryCreateQuickInfoSourceReturnsTemplateQuickInfoSource()
 {
     ITemplateEditorOptions options = OptionsWithQuickInfoTooltipsEnabled(true);
     var provider = new TemplateQuickInfoSourceProvider(options);
     var textBuffer = new FakeTextBuffer(string.Empty);
     IQuickInfoSource quickInfoSource = provider.TryCreateQuickInfoSource(textBuffer);
     Assert.Equal(typeof(TemplateQuickInfoSource), quickInfoSource.GetType());
 }
 public static void CreateTaggerThrowsArgumentNullExceptionWhenBufferIsNullToFailFast()
 {
     var provider = new TemplateQuickInfoSourceProvider(Substitute.For<ITemplateEditorOptions>());
     var e = Assert.Throws<ArgumentNullException>(() => provider.TryCreateQuickInfoSource(null));
     Assert.Equal("buffer", e.ParamName);
 }
 public static void TryCreateQuickInfoSourceReturnsNullWhenQuickInfoTooltipsAreDisabled()
 {
     ITemplateEditorOptions options = OptionsWithQuickInfoTooltipsEnabled(false);
     var provider = new TemplateQuickInfoSourceProvider(options);
     Assert.Null(provider.TryCreateQuickInfoSource(new FakeTextBuffer(string.Empty)));
 }
 public static void TryCreateQuickInfoSourceReturnsSameObjectWhenCalledMultipleTimesForSameBuffer()
 {
     ITemplateEditorOptions options = OptionsWithQuickInfoTooltipsEnabled(true);
     var provider = new TemplateQuickInfoSourceProvider(options);
     var textBuffer = new FakeTextBuffer(string.Empty);
     IQuickInfoSource source1 = provider.TryCreateQuickInfoSource(textBuffer);
     IQuickInfoSource source2 = provider.TryCreateQuickInfoSource(textBuffer);
     Assert.Same(source1, source2);
 }