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(); }
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); }