public void TextBufferChangeRemovesOldTagSpans()
 {
     var buffer = new FakeTextBuffer("<#");
     var tagger = new TemplateClassificationTagger(buffer, this.registry);
     buffer.CurrentSnapshot = new FakeTextSnapshot(string.Empty);
     Assert.False(tagger.GetTaggedSpans(new SnapshotSpan(buffer.CurrentSnapshot, 0, buffer.CurrentSnapshot.Length)).Any());
 }
        public void TextBufferChangeRaisesTagsChangedEvent()
        {
            var buffer = new FakeTextBuffer(string.Empty);
            var tagger = new TemplateClassificationTagger(buffer, this.registry);

            bool tagsChangedEventRaised = false;
            tagger.TagsChanged += (sender, args) => tagsChangedEventRaised = true;

            buffer.CurrentSnapshot = new FakeTextSnapshot("<#");
            Assert.True(tagsChangedEventRaised);
        }
 private IEnumerable<ITagSpan<ClassificationTag>> GetTags(string text)
 {
     var buffer = new FakeTextBuffer(text);
     var tagger = new TemplateClassificationTagger(buffer, this.registry);
     var spans = new NormalizedSnapshotSpanCollection(new SnapshotSpan(buffer.CurrentSnapshot, 0, buffer.CurrentSnapshot.Length));
     return tagger.GetTags(spans);
 }