private static Guid SaveTestAggregateWithoutCustomHeaders(IRepository repository, int numberOfEvents) { var aggregateToSave = new TestWoftamAggregate(Guid.NewGuid()); aggregateToSave.ProduceEvents(numberOfEvents); repository.Save(aggregateToSave); return(aggregateToSave.Id); }
public void ClearsEventsFromAggregateOnceCommitted() { var aggregateToSave = new TestWoftamAggregate(Guid.NewGuid()); aggregateToSave.ProduceEvents(10); _repo.Save(aggregateToSave); Assert.Empty(((IEventSource)aggregateToSave).TakeEvents()); }