コード例 #1
0
ファイル: Server.cs プロジェクト: DmitryNaumov/TestCQRS
 public Server(IEventPublisher eventPublisher, IDomainModelStateManager stateManager, ICommandProcessorFactory commandProcessorFactory, IUnitOfWorkFactory unitOfWorkFactory)
 {
     _eventPublisher = eventPublisher;
     _stateManager = stateManager;
     _commandProcessorFactory = commandProcessorFactory;
     _unitOfWorkFactory = unitOfWorkFactory;
 }
コード例 #2
0
        public void Setup()
        {
            this.commandParser           = Mock.Of <ICommandParser>();
            this.validCommandsCatalog    = Mock.Of <IValidCommandsCatalog>();
            this.commandProcessorFactory = Mock.Of <ICommandProcessorFactory>();

            Mock.Get(this.validCommandsCatalog).Setup(x => x.GetValidCommands()).Returns(new[] { "stock" });
            this.sut = new ChatBot(this.commandParser, this.validCommandsCatalog, this.commandProcessorFactory);
        }
コード例 #3
0
 public HattemSessionFactoryMock(
     ICommandProcessorFactory <HattemSessionMock> commandProcessorFactory,
     INotificationPublisher <HattemSessionMock> notificationPublisher,
     IQueryProcessorFactory <HattemSessionMock> queryProcessorFactory
     )
 {
     _commandProcessor      = commandProcessorFactory?.Create() ?? throw new ArgumentNullException(nameof(commandProcessorFactory));
     _queryProcessor        = queryProcessorFactory?.Create() ?? throw new ArgumentNullException(nameof(queryProcessorFactory));
     _notificationPublisher = notificationPublisher ?? throw new ArgumentNullException(nameof(notificationPublisher));
 }
コード例 #4
0
 public SqlHattemSessionFactory(
     ICommandProcessorFactory <SqlHattemSession> commandProcessorFactory,
     INotificationPublisher <SqlHattemSession> notificationPublisher,
     IQueryProcessorFactory <SqlHattemSession> queryProcessorFactory,
     IDbConnectionFactory dbConnectionFactory
     )
 {
     _commandProcessor      = commandProcessorFactory?.Create() ?? throw new ArgumentNullException(nameof(commandProcessorFactory));
     _queryProcessor        = queryProcessorFactory?.Create() ?? throw new ArgumentNullException(nameof(queryProcessorFactory));
     _notificationPublisher = notificationPublisher ?? throw new ArgumentNullException(nameof(notificationPublisher));
     _dbConnectionFactory   = dbConnectionFactory ?? throw new ArgumentNullException(nameof(dbConnectionFactory));
 }
コード例 #5
0
 public Connection(
     IErrorReporter errorReporter,
     IDataEnumeratorFactory dataEnumeratorFactory,
     ICommandProcessorFactory commandProcessorFactory,
     ISchemaUpdater schemaUpdater)
 {
     _errorReporter           = errorReporter;
     _dataEnumeratorFactory   = dataEnumeratorFactory;
     _commandProcessorFactory = commandProcessorFactory;
     _schemaUpdater           = schemaUpdater;
     _activeCount++;
 }
コード例 #6
0
ファイル: CommandProcessor.cs プロジェクト: cberberian/Brain
 public CommandProcessor(ICommandProcessorFactory commandProcessorFactory, User myUser, Bot myBot)
 {
     _commandProcessorFactory = commandProcessorFactory;
     _myUser = myUser;
     _myBot = myBot;
 }
コード例 #7
0
 public ExampleController(ICommandProcessorFactory commandProcessorFactory)
 {
     _commandProcessorFactory = commandProcessorFactory ?? throw new ArgumentNullException(nameof(commandProcessorFactory));
 }
コード例 #8
0
 public ChatBot(ICommandParser commandParser, IValidCommandsCatalog validCommandsCatalog, ICommandProcessorFactory commandProcessorFactory)
 {
     this.commandParser           = commandParser;
     this.validCommandsCatalog    = validCommandsCatalog;
     this.commandProcessorFactory = commandProcessorFactory;
 }