Exemplo n.º 1
0
        private void InsertAndRead(IEvent @event)
        {
            _eventToPublishRepository.Add(@event);
            _eventToPublishRepository.UnitOfWork.Commit();
            var eventToPublish = _eventToPublishRepository.Read(@event.Id);

            _retrievedEvent = _eventToPublishSerializer.Deserialize(eventToPublish);
        }
Exemplo n.º 2
0
 public void Add(IEvent @event)
 {
     // This is all a bit smoke-and-mirrors, but I can't think of a better way to do this without having to change to the OutboxEventPublisher / EventToPublishRepository
     // *specifically* for testing purposes, which always feels wrong. At least this way, the extra complication is contained within the tests, and not the
     // system-under-test.
     OnBeforeAdding(@event);
     _eventToPublishRepository.Add(@event);
     OnAfterAdding(@event);
 }