Ejemplo n.º 1
0
        public void Setup()
        {
            var eventStore         = new TestEventStore();
            var testEventPublisher = new TestEventPublisher();
            var snapshotStore      = new NullSnapshotStore();

            _rep = new Repository <TestAggregate>(eventStore, snapshotStore, testEventPublisher);
        }
        public void Setup()
        {
            var eventStore     = new TestEventStore();
            var eventPublisher = new TestEventPublisher();
            var snapshotStore  = new NullSnapshotStore();
            var rep            = new Repository <TestSnapshotAggreagate>(eventStore, snapshotStore, eventPublisher);

            _aggregate = rep.Get(Guid.NewGuid());
        }
 public void Setup()
 {
     var eventStore = new TestEventStore();
     var snapshotStore = new NullSnapshotStore();
     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_a_snapshot_aggregate_with_no_snapshot()
 {
     var eventStore = new TestEventStore();
     var snapshotStore = new NullSnapshotStore();
     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());
 }
Ejemplo n.º 5
0
        public void Setup()
        {
            _eventStore     = new TestEventStore();
            _eventPublisher = new TestEventPublisher();
            var snapshotstore = new NullSnapshotStore();

            _rep       = new Repository <TestAggregateNoParameterLessConstructor>(_eventStore, snapshotstore, _eventPublisher);
            _aggregate = new TestAggregateNoParameterLessConstructor(2);
        }
Ejemplo n.º 6
0
        public When_getting_a_snapshot_aggregate_with_no_snapshot()
        {
            var eventStore       = new TestEventStore();
            var snapshotStore    = new NullSnapshotStore();
            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()).Result;
        }
        public void Setup()
        {
            var eventStore       = new TestEventStore();
            var snapshotStore    = new NullSnapshotStore();
            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 GetSnapshotAggregateWithNoSnapshotTest()
        {
            var eventStore       = new TestEventStore();
            var snapshotStore    = new NullSnapshotStore();
            var snapshotStrategy = new DefaultSnapshotStrategy(snapshotStore);
            var repository       = new SnapshotRepository(snapshotStore, snapshotStrategy, new Repository(eventStore), eventStore);
            var session          = new Session(repository);

            _aggregate = session.GetAsync <TestSnapshotAggregate>(Guid.NewGuid().ToString()).Result;
        }
        public When_getting_a_snapshot_aggregate_with_no_snapshot()
        {
            _eventStore = new TestEventStore();
            var snapshotStore    = new NullSnapshotStore();
            var snapshotStrategy = new DefaultSnapshotStrategy();
            var repository       = new SnapshotRepository(snapshotStore, snapshotStrategy, new Repository(_eventStore), _eventStore);
            var session          = new Session(repository);

            _token     = new CancellationToken();
            _aggregate = session.Get <TestSnapshotAggregate>(Guid.NewGuid(), cancellationToken: _token).Result;
        }
Ejemplo n.º 10
0
        public void Setup()
        {
            var eventStore       = new TestSnapshotEventStore();
            var eventPublisher   = new TestEventPublisher();
            var snapshotStore    = new NullSnapshotStore();
            var snapshotStrategy = new DefaultSnapshotStrategy <ISingleSignOnToken>();
            var aggregateFactory = new AggregateFactory(new TestDependencyResolver());
            var repository       = new SnapshotRepository <ISingleSignOnToken>(snapshotStore, snapshotStrategy, new Repository <ISingleSignOnToken>(aggregateFactory, eventStore, eventPublisher, new NullCorrelationIdHelper()), eventStore, aggregateFactory);
            var session          = new UnitOfWork <ISingleSignOnToken>(repository);

            _aggregate = session.Get <TestSnapshotAggregate>(Guid.NewGuid());
        }
        public void Setup()
        {
            var eventStore       = new TestSnapshotEventStore();
            var eventPublisher   = new TestEventPublisher();
            var snapshotStore    = new NullSnapshotStore();
            var snapshotStrategy = new DefaultSnapshotStrategy <ISingleSignOnToken>();

            _dependencyResolver = new TestDependencyResolver(null);
            var  aggregateFactory = new AggregateFactory(_dependencyResolver, _dependencyResolver.Resolve <ILogger>());
            var  repository       = new SnapshotRepository <ISingleSignOnToken>(snapshotStore, snapshotStrategy, new AggregateRepository <ISingleSignOnToken>(aggregateFactory, eventStore, eventPublisher, new NullCorrelationIdHelper(), new ConfigurationManager()), eventStore, aggregateFactory);
            var  session          = new UnitOfWork <ISingleSignOnToken>(repository);
            Guid id = Guid.NewGuid();

            _dependencyResolver.NewAggregateGuid = id;
            _aggregate = session.Get <TestSnapshotAggregate>(id);
        }
 public void Setup()
 {
     _snapshotstore = new NullSnapshotStore();
     _snapshot      = new TestSnapshotAggregateSnapshot();
     _snapshotstore.Save(_snapshot);
 }