public void Setup() { this.stServerSingleton = new StServerMockSingleton(); this.stServer = this.stServerSingleton.Instance; this.handlers = new SmartComHandlersDatabase(); this.handlers.Add <_IStClient_ConnectedEventHandler>(ConnectedHandler); this.handlers.Add <_IStClient_DisconnectedEventHandler>(DisconnectedHandler); this.binder = new SmartComBinder(this.stServer, this.handlers, new NullLogger()); this.connector = new SmartComConnector(this.stServer, this.handlers, new NullLogger()); this.subscriber = new SmartComSubscriber(this.stServer, new NullLogger()); this.subscriber.Portfolios.Add("ST88888-RF-01"); this.subscriber.Ticks.Add("RTS-6.13_FT"); this.subscriber.Quotes.Add("RTS-6.13_FT"); this.subscriber.BidsAndAsks.Add("RTS-6.13_FT"); this.trader = new SmartComAdapter(this.connector, this.handlers, this.binder, this.subscriber, this.stServerSingleton, new NullLogger(), 1); Assert.AreEqual(0, this.subscriber.SubscriptionsCounter); }
public void SetUp() { this.stServerSingleton = new StServerMockSingleton(); this.stServer = this.stServerSingleton.Instance; this.handlers = new SmartComHandlersDatabase(); this.binder = new SmartComBinder(this.stServerSingleton.Instance, this.handlers, new NullLogger()); }
public SmartComAdapter(IConnector connector, SmartComHandlersDatabase handlers, IBinder binder, ISubscriber subscriber, IGenericSingleton <StServer> stServerSingleton, ILogger logger, int monitorTimeoutSeconds = 20) { this.stServerSingleton = stServerSingleton; this.stServer = this.stServerSingleton.Instance; this.handlers = handlers; this.binder = binder; this.subscriber = subscriber; this.logger = logger; this.connector = connector; this.monitorTimeoutSeconds = monitorTimeoutSeconds; this.defaultAdapterHandlers = new AdapterHandlers(); this.seconds = AppSettings.GetValue <int>("SecondsBetweenConnectionAwaitingAttempts"); this.handlers.Add <_IStClient_ConnectedEventHandler>(SmartComTraderConnected); this.handlers.Add <_IStClient_DisconnectedEventHandler>(SmartComTraderDisconnected); this.dataFlowMonitorTimer = new Timer(MonitorDataFlow, null, this.monitorTimeoutSeconds * 1000, 1000 * this.seconds); this.connectionMonitorTimer = new Timer(MonitorConnection, null, this.monitorTimeoutSeconds * 1000, 1000 * this.seconds); }
public void Setup() { this.stServer = new StServerClassMock(); this.handlers = new SmartComHandlersDatabase(); this.binder = new SmartComBinder(this.stServer, this.handlers, new NullLogger()); this.connector = new SmartComConnector(this.stServer, this.handlers, new NullLogger()); this.binder.Bind(); }
public FakeAdapterBase() { this.handlers = new SmartComHandlersDatabase(); this.mockSingleton = new StServerMockSingleton(); this.subscriber = new SmartComSubscriber(this.mockSingleton.Instance, new NullLogger()); this.binder = new SmartComBinder(this.mockSingleton.Instance, this.handlers, new NullLogger()); this.connector = new SmartComConnector(this.mockSingleton.Instance, this.handlers, new NullLogger()); }
public SmartComConnector(StServer stServer, SmartComHandlersDatabase handlers, ILogger logger) { this.stServer = stServer; this.handlers = handlers; this.logger = logger; this.cc = new ConnectionCredentials(); this.handlers.Add <_IStClient_ConnectedEventHandler>(ConnectionSucceed); this.handlers.Add <_IStClient_DisconnectedEventHandler>(ConnectorDisconnected); }
public void Setup() { this.rawTradingDataContext = new RawTradingDataContext(); this.stServerSingleton = new StServerMockSingleton(); this.handlers = new SmartComHandlersDatabase(); this.binder = new SmartComBinder(this.stServerSingleton.Instance, this.handlers, new NullLogger()); this.provider = new RawTradingDataProvider(this.handlers, this.rawTradingDataContext, new NullLogger()); this.binder.Bind(); this.stServer = (StServerClassMock)this.stServerSingleton.Instance; }
public SmartComBinder(StServer stServer, SmartComHandlersDatabase handlers, ILogger logger) { this.logger = logger; this.stServer = stServer; this.handlers = handlers; }
public void Setup() { this.smartComHandlers = new SmartComHandlersDatabase(); }