Esempio n. 1
0
        public ClientCommandDispatcherTests()
        {
            var eventBus              = new EventBus();
            var parser                = new ConnectionStringParser();
            var configuration         = parser.Parse("host=localhost");
            var hostSelectionStrategy = new RandomClusterHostSelectionStrategy <ConnectionFactoryInfo>();
            var connectionFactory     = new ConnectionFactoryWrapper(configuration, hostSelectionStrategy);

            connection = new PersistentConnection(connectionFactory, eventBus);
            var persistentChannelFactory = new PersistentChannelFactory(configuration, eventBus);

            dispatcher = new ClientCommandDispatcher(configuration, connection, persistentChannelFactory);
            connection.Initialize();
        }
Esempio n. 2
0
        public void SetUp()
        {
            var eventBus              = new EventBus();
            var logger                = new ConsoleLogger();
            var parser                = new ConnectionStringParser();
            var configuration         = parser.Parse("host=localhost");
            var hostSelectionStrategy = new RandomClusterHostSelectionStrategy <ConnectionFactoryInfo>();
            var connectionFactory     = new ConnectionFactoryWrapper(configuration, hostSelectionStrategy);

            connection = new PersistentConnection(connectionFactory, logger, eventBus);
            var persistentChannelFactory = new PersistentChannelFactory(logger, configuration, eventBus);

            dispatcher = new ClientCommandDispatcher(connection, persistentChannelFactory);
        }