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 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); }