public void Setup()
        {
            var eventStore = new TestInMemoryEventStore();
            _snapshotStore = new TestSnapshotStore();
            var snapshotStrategy = new DefaultSnapshotStrategy();
            var repository = new SnapshotRepository(_snapshotStore, snapshotStrategy, new Repository(eventStore), eventStore);
            var session = new Session(repository);

            _aggregate = session.Get<TestSnapshotAggregate>(Guid.NewGuid());
        }
        public When_getting_an_aggregate_with_snapshot()
        {
            var eventStore = new TestInMemoryEventStore();
            var snapshotStore = new TestSnapshotStore();
            var snapshotStrategy = new DefaultSnapshotStrategy();
            var snapshotRepository = new SnapshotRepository(snapshotStore, snapshotStrategy, new Repository(eventStore), eventStore);
            var session = new Session(snapshotRepository);

            _aggregate = session.Get<TestSnapshotAggregate>(Guid.NewGuid());
        }
        public When_getting_snapshotable_aggreate()
        {
            var eventStore = new TestInMemoryEventStore();
            var eventPublisher = new TestEventPublisher();
            _snapshotStore = new TestSnapshotStore();
            var snapshotStrategy = new DefaultSnapshotStrategy();
            var repository = new SnapshotRepository(_snapshotStore, snapshotStrategy, new Repository(eventStore, eventPublisher), eventStore);
            var session = new Session(repository);

            _aggregate = session.Get<TestSnapshotAggregate>(Guid.NewGuid());
        }
 public void Setup()
 {
     var eventStore = new TestInMemoryEventStore();
     _snapshotStore = new TestSnapshotStore();
     var snapshotStrategy = new DefaultSnapshotStrategy();
     var repository = new SnapshotRepository(_snapshotStore, snapshotStrategy, new Repository(eventStore), eventStore);
     var session = new Session(repository);
     var aggregate = new TestSnapshotAggregate();
     for (var i = 0; i < 200; i++)
     {
         aggregate.DoSomething();
     }
     session.Add(aggregate);
     session.Commit();
 }
 public When_saving_a_snapshotable_aggregate()
 {
     var eventStore = new TestInMemoryEventStore();
     var eventPublisher = new TestEventPublisher();
     _snapshotStore = new TestSnapshotStore();
     var snapshotStrategy = new DefaultSnapshotStrategy();
     var repository = new SnapshotRepository(_snapshotStore, snapshotStrategy, new Repository(eventStore, eventPublisher), eventStore);
     var session = new Session(repository);
     var aggregate = new TestSnapshotAggregate();
     for (var i = 0; i < 30; i++)
     {
         aggregate.DoSomething();
     }
     session.Add(aggregate);
     session.Commit();
 }