예제 #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);
        }
예제 #2
0
        public void ClearsEventsFromAggregateOnceCommitted()
        {
            var aggregateToSave = new TestWoftamAggregate(Guid.NewGuid());

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

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