public static void CreateTaggerThrowsArgumentNullExceptionWhenBufferIsNullToFailFast() { var provider = new TemplateOutliningTaggerProvider(Substitute.For <ITemplateEditorOptions>()); var e = Assert.Throws <ArgumentNullException>(() => provider.CreateTagger <OutliningRegionTag>(null)); Assert.Equal("buffer", e.ParamName); }
public static void CreateTaggerDoesNotReturnTaggerWhenTemplateOutliningIsDisabled() { ITemplateEditorOptions options = OptionsWithTemplateOutliningEnabled(false); var provider = new TemplateOutliningTaggerProvider(options); Assert.Null(provider.CreateTagger <OutliningRegionTag>(new FakeTextBuffer(string.Empty))); }
public static void CreateTaggerReturnsTemplateOutliningTagger() { ITemplateEditorOptions options = OptionsWithTemplateOutliningEnabled(true); var provider = new TemplateOutliningTaggerProvider(options); var tagger = provider.CreateTagger <OutliningRegionTag>(new FakeTextBuffer(string.Empty)); Assert.Equal(typeof(TemplateOutliningTagger), tagger.GetType()); }
public static void CreateTaggerReturnsSingleTaggerWhenCalledMultipleTimesForSameBuffer() { ITemplateEditorOptions options = OptionsWithTemplateOutliningEnabled(true); var provider = new TemplateOutliningTaggerProvider(options); var buffer = new FakeTextBuffer(string.Empty); var tagger1 = provider.CreateTagger <OutliningRegionTag>(buffer); var tagger2 = provider.CreateTagger <OutliningRegionTag>(buffer); Assert.Same(tagger1, tagger2); }