public void SuppressDocument_KnownAndUpdatedDocument_TriggersUpdate()
        {
            // Arrange
            var          provider     = new DefaultRazorDynamicDocumentInfoProvider(Factory);
            DocumentInfo documentInfo = null;

            provider.Updated += (info) =>
            {
                documentInfo = info;
            };

            // Populate the providers understanding of our project/document
            provider.GetDynamicDocumentInfo(ProjectId.CreateNewId(), ProjectSnapshot.FilePath, DocumentSnapshot.FilePath);
            var documentContainer = new DefaultDynamicDocumentContainer(DocumentSnapshot);

            // Update the document with content
            provider.UpdateFileInfo(ProjectSnapshot.FilePath, documentContainer);

            // Act
            provider.SuppressDocument(ProjectSnapshot.FilePath, DocumentSnapshot.FilePath);

            // Assert
            Assert.NotNull(documentInfo);
            Assert.Equal(DocumentSnapshot.FilePath, documentInfo.FilePath);
        }
        public void SuppressDocument_UnknownDocument_Noops()
        {
            // Arrange
            var provider = new DefaultRazorDynamicDocumentInfoProvider(Factory);

            provider.Updated += (_) => throw new XunitException("This should not have been called.");

            // Act & Assert
            provider.SuppressDocument(ProjectSnapshot, DocumentSnapshot);
        }
        public void UpdateFileInfo_UnknownDocument_Noops()
        {
            // Arrange
            var provider = new DefaultRazorDynamicDocumentInfoProvider(Factory);

            provider.Updated += (_) => throw new XunitException("This should not have been called.");
            var documentContainer = new DefaultDynamicDocumentContainer(DocumentSnapshot);

            // Act & Assert
            provider.UpdateFileInfo(ProjectSnapshot.FilePath, documentContainer);
        }
        public void SuppressDocument_KnownDocument_NotUpdated_Noops()
        {
            // Arrange
            var provider = new DefaultRazorDynamicDocumentInfoProvider(Factory);

            provider.Updated += (_) => throw new XunitException("This should not have been called.");

            // Populate the providers understanding of our project/document
            provider.GetDynamicDocumentInfo(ProjectId.CreateNewId(), ProjectSnapshot.FilePath, DocumentSnapshot.FilePath);

            // Act & Assert
            provider.SuppressDocument(ProjectSnapshot, DocumentSnapshot);
        }
        public void RemoveDynamicDocumentInfo_UntracksDocument()
        {
            // Arrange
            var provider = new DefaultRazorDynamicDocumentInfoProvider(Factory);

            // Populate the providers understanding of our project/document
            provider.GetDynamicDocumentInfo(ProjectId.CreateNewId(), ProjectSnapshot.FilePath, DocumentSnapshot.FilePath);

            // Update the document with content
            provider.UpdateFileInfo(ProjectSnapshot, DocumentSnapshot);

            // Now explode if any further updates happen
            provider.Updated += (_) => throw new XunitException("This should not have been called.");

            // Act
            provider.RemoveDynamicDocumentInfo(ProjectId.CreateNewId(), ProjectSnapshot.FilePath, DocumentSnapshot.FilePath);

            // Assert this should not update
            provider.UpdateFileInfo(ProjectSnapshot, DocumentSnapshot);
        }