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);
        }
Пример #4
0
        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;
        }
Пример #6
0
        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;
            }
        }
Пример #8
0
        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;
 }
Пример #11
0
 public OrderStream(ILsStreamingClientAccountConnection lsCityindexStreamingClientConnection)
 {
     _lsCityindexStreamingClientConnection = lsCityindexStreamingClientConnection;
 }
Пример #12
0
 public void Setup()
 {
     _mockLsStreamingClientAccountConnection = MockRepository.GenerateMock <ILsStreamingClientAccountConnection>();
 }