Exemplo n.º 1
0
        private static Guid SaveTestAggregateWithoutCustomHeaders(IRepository repository, int numberOfEvents)
        {
            var aggregateToSave = new TestWoftamAggregate(Guid.NewGuid());

            aggregateToSave.ProduceEvents(numberOfEvents);
            repository.Save(aggregateToSave);
            return(aggregateToSave.Id);
        }
Exemplo n.º 2
0
        public void ClearsEventsFromAggregateOnceCommitted()
        {
            var aggregateToSave = new TestWoftamAggregate(Guid.NewGuid());

            aggregateToSave.ProduceEvents(10);
            _repo.Save(aggregateToSave);

            Assert.Empty(((IEventSource)aggregateToSave).TakeEvents());
        }