Ejemplo n.º 1
0
        public EventHandlerFactory(IQueryDataStore queryDataStore, IIdempotencyChecker idempotencyChecker, IDatabaseLayer databaseLayer)
        {
            _queryDataStore     = queryDataStore;
            _idempotencyChecker = idempotencyChecker;
            _databaseLayer      = databaseLayer;

            _idempotencyChecker.DatabaseLayer = _databaseLayer;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Mockable Constructor
        /// </summary>
        /// <param name="table">Data Store</param>
        public ImageDataApi(IQueryDataStore dataStore)
        {
            if (null == dataStore)
            {
                throw new ArgumentNullException("dataStore");
            }

            this.dataStore = dataStore;
        }
        /// <summary>
        /// Mockable Constructor
        /// </summary>
        /// <param name="table">Data Store</param>
        public ImageDataApi(IQueryDataStore dataStore)
        {
            if (null == dataStore)
            {
                throw new ArgumentNullException("dataStore");
            }

            this.dataStore = dataStore;
        }
Ejemplo n.º 4
0
        private void HandleEvents(IEnumerable <IEvent> events, IQueryDataStore queryDataStore)
        {
            var mockIdempotencyChecker = new Mock <IIdempotencyChecker>();
            var mockDatabaseLayer      = new Mock <IDatabaseLayer>();

            mockDatabaseLayer.Setup(x => x.ExecuteInTransaction(It.IsAny <Action>())).Callback <Action>(x => x());

            var eventHandler = new EventHandlerFactory(queryDataStore, mockIdempotencyChecker.Object, mockDatabaseLayer.Object);

            foreach (IEvent e in events)
            {
                eventHandler.HandleEvent(e);
            }
        }
        private void HandleEvents(IEnumerable<IEvent> events, IQueryDataStore queryDataStore)
        {
            var mockIdempotencyChecker = new Mock<IIdempotencyChecker>();
            var mockDatabaseLayer = new Mock<IDatabaseLayer>();

            mockDatabaseLayer.Setup(x => x.ExecuteInTransaction(It.IsAny<Action>())).Callback<Action>(x => x());

            var eventHandler = new EventHandlerFactory(queryDataStore, mockIdempotencyChecker.Object, mockDatabaseLayer.Object);

            foreach (IEvent e in events)
            {
                eventHandler.HandleEvent(e);
            }
        }
Ejemplo n.º 6
0
 public GetTodoListsHandler(IQueryDataStore dataStore)
 {
     _dataStore = dataStore;
 }
 public AddTodoHandler(IQueryDataStore store)
 {
     _store = store;
 }
 public QueryHandlerFactory(IQueryDataStore queryDataStore)
 {
     _queryDataStore = queryDataStore;
 }
 public RemoveTodoHandler(IQueryDataStore store)
 {
     _store = store;
 }
Ejemplo n.º 10
0
 public QueryHandler(IQueryDataStore queryDataStore)
 {
     _queryDataStore = queryDataStore;
 }