public void RemoveTextView_UnsubscribesAfterLastTextViewRemoved()
        {
            // Arrange
            var documentTracker = new DefaultVisualStudioDocumentTracker(FilePath, ProjectManager, ProjectService, EditorSettingsManager, Workspace, TextBuffer);
            var textView1       = Mock.Of <ITextView>();
            var textView2       = Mock.Of <ITextView>();

            documentTracker.AddTextView(textView1);
            documentTracker.AddTextView(textView2);

            // Act - 1
            documentTracker.RemoveTextView(textView1);

            // Assert - 1
            Assert.True(documentTracker.IsSupportedProject);

            // Act - 2
            documentTracker.RemoveTextView(textView2);

            // Assert - 2
            Assert.False(documentTracker.IsSupportedProject);
        }
        public void RemoveTextView_RemovesTextViewFromCollection_SingleItem()
        {
            // Arrange
            var documentTracker = new DefaultVisualStudioDocumentTracker(FilePath, ProjectManager, ProjectService, EditorSettingsManager, Workspace, TextBuffer);
            var textView        = Mock.Of <ITextView>();

            documentTracker.AddTextView(textView);

            // Act
            documentTracker.RemoveTextView(textView);

            // Assert
            Assert.Empty(documentTracker.TextViews);
        }
        public void RemoveTextView_NoopsWhenRemovingTextViewNotInCollection()
        {
            // Arrange
            var documentTracker = new DefaultVisualStudioDocumentTracker(FilePath, ProjectManager, ProjectService, EditorSettingsManager, Workspace, TextBuffer);
            var textView1       = Mock.Of <ITextView>();

            documentTracker.AddTextView(textView1);
            var textView2 = Mock.Of <ITextView>();

            // Act
            documentTracker.RemoveTextView(textView2);

            // Assert
            Assert.Collection(documentTracker.TextViews, v => Assert.Same(v, textView1));
        }