Пример #1
0
        public void ClearMessages_WithSomePendingMessages_MessagesCleared()
        {
            var entity = new TestAggregateRoot();

            entity.AddEvent <TestDomainEventOne>();
            entity.AddEvent <TestDomainEventTwo>();
            entity.AddEvent <TestDomainEventOne>();
            entity.ClearMessages();

            entity.DomainEvents.Should().NotBeNull();
            entity.DomainEvents.Should().BeEmpty();
        }