Example #1
0
        public void Publish_DontPublishAlreadyPublished()
        {
            var logbookEntry = new LogbookEntry {
                IsPublished = true
            };

            logbookEntry.Publish();

            logbookEntry.IsPublished.Should().BeTrue();
            logbookEntry.UncommittedDomainEvents.Should().BeEmpty();
        }
Example #2
0
        public void Publish_PublishUnpublished()
        {
            var logbookEntry = new LogbookEntry {
                IsPublished = false
            };

            logbookEntry.Publish();

            logbookEntry.IsPublished.Should().BeTrue();
            logbookEntry.UncommittedDomainEvents.Should().ContainSingle(e => e is LogbookEntryPublishedEvent);
        }