示例#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());
        }