public void SetUp() { _mockApiConnection = MockRepository.GenerateMock<IApiConnection>(); _mockLsCityindexStreamingConnectionFactory = MockRepository.GenerateMock<LsCityindexStreamingConnectionFactory>(); _mockLsStreamingClientAccountConnectionFactory = MockRepository.GenerateMock<LsStreamingClientAccountConnectionFactory>(); _mockLsCityindexStreamingConnection = MockRepository.GenerateMock<ILsCityindexStreamingConnection>(); _mockLsStreamingClientAccountConnection = MockRepository.GenerateMock<ILsStreamingClientAccountConnection>(); }
public void SetUp() { _mockApiConnection = MockRepository.GenerateMock <IApiConnection>(); _mockLsCityindexStreamingConnectionFactory = MockRepository.GenerateMock <LsCityindexStreamingConnectionFactory>(); _mockLsStreamingClientAccountConnectionFactory = MockRepository.GenerateMock <LsStreamingClientAccountConnectionFactory>(); _mockLsCityindexStreamingConnection = MockRepository.GenerateMock <ILsCityindexStreamingConnection>(); _mockLsStreamingClientAccountConnection = MockRepository.GenerateMock <ILsStreamingClientAccountConnection>(); }
public void SetUp() { _mockStreamingManager = MockRepository.GenerateMock<IStreamingManager>(); _mockPriceStreamFactory = MockRepository.GenerateMock<IPriceStreamFactory>(); _mockNewsStreamFactory = MockRepository.GenerateMock<INewsStreamFactory>(); _mockOrderStreamFactory = MockRepository.GenerateMock<IOrderStreamFactory>(); _streams = new Streams(_mockStreamingManager, _mockPriceStreamFactory, _mockNewsStreamFactory, _mockOrderStreamFactory); _mockLsCityindexStreamingConnection = MockRepository.GenerateMock<ILsCityindexStreamingConnection>(); _mockLStreamingClientAccountConnection = MockRepository.GenerateMock<ILsStreamingClientAccountConnection>(); _mockApiConnection = MockRepository.GenerateMock<IApiConnection>(); _mockLightStreamerConnectionManager = MockRepository.GenerateMock<LightStreamerConnectionManager>(_mockApiConnection); }
public void SetUp() { _mockStreamingManager = MockRepository.GenerateMock <IStreamingManager>(); _mockPriceStreamFactory = MockRepository.GenerateMock <IPriceStreamFactory>(); _mockNewsStreamFactory = MockRepository.GenerateMock <INewsStreamFactory>(); _mockOrderStreamFactory = MockRepository.GenerateMock <IOrderStreamFactory>(); _streams = new Streams(_mockStreamingManager, _mockPriceStreamFactory, _mockNewsStreamFactory, _mockOrderStreamFactory); _mockLsCityindexStreamingConnection = MockRepository.GenerateMock <ILsCityindexStreamingConnection>(); _mockLStreamingClientAccountConnection = MockRepository.GenerateMock <ILsStreamingClientAccountConnection>(); _mockApiConnection = MockRepository.GenerateMock <IApiConnection>(); _mockLightStreamerConnectionManager = MockRepository.GenerateMock <LightStreamerConnectionManager>(_mockApiConnection); }
public virtual void ConnectToStreamingClientAccountAdapter(string streamingUrl, LsStreamingClientAccountConnectionFactory lsStreamingClientAccountConnectionFactory) { if (_streamingClientAccountAdapterIsConnected) throw new InvalidOperationException("Can only have one connection open to a lightstreamer streaming client account adapter."); var streamingClientAccountAdapterUri = streamingUrl + STREAMING_CLIENT_ACCOUNT_ADAPTER; Log.Info("Connecting to lightstreamer uri: " + streamingClientAccountAdapterUri); _lsStreamingClientAccountConnection = lsStreamingClientAccountConnectionFactory.Create(new Uri(streamingClientAccountAdapterUri), _apiConnection.UserName, _apiConnection.Session); if (_lsStreamingClientAccountConnection == null) throw new NullReferenceException("Could not create StreamingClientAccount adapter connection."); _lsStreamingClientAccountConnection.StatusChanged += new EventHandler<StatusEventArgs>(LsStreamingClientAccountConnectionStatusChanged); _lsStreamingClientAccountConnection.Connect(); _streamingClientAccountAdapterIsConnected = true; }
public OrderStream Create(ILsStreamingClientAccountConnection lsCityindexStreamingClientConnection) { try { Log.Info("Creating order stream listener."); var orderStream = new OrderStream(lsCityindexStreamingClientConnection); return(orderStream); } catch (Exception ex) { Log.Error(ex); throw; } }
public OrderStream Create(ILsStreamingClientAccountConnection lsCityindexStreamingClientConnection) { try { Log.Info("Creating order stream listener."); var orderStream = new OrderStream(lsCityindexStreamingClientConnection); return orderStream; } catch (Exception ex) { Log.Error(ex); throw; } }
public virtual void ConnectToStreamingClientAccountAdapter(string streamingUrl, LsStreamingClientAccountConnectionFactory lsStreamingClientAccountConnectionFactory) { if (_streamingClientAccountAdapterIsConnected) { throw new InvalidOperationException("Can only have one connection open to a lightstreamer streaming client account adapter."); } var streamingClientAccountAdapterUri = streamingUrl + STREAMING_CLIENT_ACCOUNT_ADAPTER; Log.Info("Connecting to lightstreamer uri: " + streamingClientAccountAdapterUri); _lsStreamingClientAccountConnection = lsStreamingClientAccountConnectionFactory.Create(new Uri(streamingClientAccountAdapterUri), _apiConnection.UserName, _apiConnection.Session); if (_lsStreamingClientAccountConnection == null) { throw new NullReferenceException("Could not create StreamingClientAccount adapter connection."); } _lsStreamingClientAccountConnection.StatusChanged += new EventHandler <StatusEventArgs>(LsStreamingClientAccountConnectionStatusChanged); _lsStreamingClientAccountConnection.Connect(); _streamingClientAccountAdapterIsConnected = true; }
public void Setup() { _mockLsStreamingClientAccountConnection = MockRepository.GenerateMock<ILsStreamingClientAccountConnection>(); }
public OrderStream(ILsStreamingClientAccountConnection lsCityindexStreamingClientConnection) { _lsCityindexStreamingClientConnection = lsCityindexStreamingClientConnection; }
public OrderStream(ILsStreamingClientAccountConnection lsCityindexStreamingClientConnection) { _lsCityindexStreamingClientConnection = lsCityindexStreamingClientConnection; }
public void Setup() { _mockLsStreamingClientAccountConnection = MockRepository.GenerateMock <ILsStreamingClientAccountConnection>(); }