public void Setup()
 {
     IEventStore eventStore = new TestInMemoryEventStore();
     var eventpubliser = new TestEventPublisher();
     _snapshotStore = new TestInMemorySnapshotStore();
     _rep = new Repository<TestSnapshotAggreagate>(eventStore, _snapshotStore, eventpubliser);
     var aggregate = new TestSnapshotAggreagate();
     for (int i = 0; i < 20; i++)
     {
         aggregate.DoSomething();
         _rep.Save(aggregate, i);
     }
 }
        public void Setup()
        {
            IEventStore eventStore = new TestInMemoryEventStore();
            var eventPublisher = new TestEventPublisher();
            _snapshotStore = new TestInMemorySnapshotStore();
            var snapshotStrategy = new DefaultSnapshotStrategy();
            var repository = new SnapshotRepository(_snapshotStore, snapshotStrategy, new Repository(eventStore, eventPublisher), eventStore);
            _session = new Session(repository);
            var aggregate = new TestSnapshotAggregate();

            for (int i = 0; i < 20; i++)
            {
                _session.Add(aggregate);
                aggregate.DoSomething();
                _session.Commit();
            }
        }