public void Publish_DontPublishAlreadyPublished() { var logbookEntry = new LogbookEntry { IsPublished = true }; logbookEntry.Publish(); logbookEntry.IsPublished.Should().BeTrue(); logbookEntry.UncommittedDomainEvents.Should().BeEmpty(); }
public void Publish_PublishUnpublished() { var logbookEntry = new LogbookEntry { IsPublished = false }; logbookEntry.Publish(); logbookEntry.IsPublished.Should().BeTrue(); logbookEntry.UncommittedDomainEvents.Should().ContainSingle(e => e is LogbookEntryPublishedEvent); }