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);
        }
Exemple #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 ConnectToCityindexStreamingAdapter(string streamingUrl, LsCityindexStreamingConnectionFactory lsCityindexStreamingConnectionFactory)
        {
            if(_cityindexStreamingAdapterIsConnected)
                throw new InvalidOperationException("Can only have one connection open to a lightstreamer cityindex streaming adapter.");

            var cityIndexStreamingAdapterUri = streamingUrl + CITYINDEX_STREAMING_ADAPTER;
            Log.Info("Connecting to lightstreamer uri: " + cityIndexStreamingAdapterUri);
            _lsCityindexStreamingConnection = lsCityindexStreamingConnectionFactory.Create(new Uri(cityIndexStreamingAdapterUri), _apiConnection.UserName, _apiConnection.Session);
            if (_lsCityindexStreamingConnection == null)
                throw new NullReferenceException("Could not create CityindexStreaming adapter connection.");

            _lsCityindexStreamingConnection.StatusChanged += new EventHandler<StatusEventArgs>(LsCityindexStreamingClientConnectionStatusChanged);
            _lsCityindexStreamingConnection.Connect();
            _cityindexStreamingAdapterIsConnected = true;
        }
        public virtual PriceStream Create(ILsCityindexStreamingConnection lsCityindexStreamingConnection)
        {
            try
            {
                Log.Info("Creating price stream listener.");

                var priceStream = new PriceStream(lsCityindexStreamingConnection);

                return(priceStream);
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                throw;
            }
        }
Exemple #7
0
        public virtual void ConnectToCityindexStreamingAdapter(string streamingUrl, LsCityindexStreamingConnectionFactory lsCityindexStreamingConnectionFactory)
        {
            if (_cityindexStreamingAdapterIsConnected)
            {
                throw new InvalidOperationException("Can only have one connection open to a lightstreamer cityindex streaming adapter.");
            }

            var cityIndexStreamingAdapterUri = streamingUrl + CITYINDEX_STREAMING_ADAPTER;

            Log.Info("Connecting to lightstreamer uri: " + cityIndexStreamingAdapterUri);
            _lsCityindexStreamingConnection = lsCityindexStreamingConnectionFactory.Create(new Uri(cityIndexStreamingAdapterUri), _apiConnection.UserName, _apiConnection.Session);
            if (_lsCityindexStreamingConnection == null)
            {
                throw new NullReferenceException("Could not create CityindexStreaming adapter connection.");
            }

            _lsCityindexStreamingConnection.StatusChanged += new EventHandler <StatusEventArgs>(LsCityindexStreamingClientConnectionStatusChanged);
            _lsCityindexStreamingConnection.Connect();
            _cityindexStreamingAdapterIsConnected = true;
        }
 public NewsStream(ILsCityindexStreamingConnection lsCityindexStreamingConnection)
 {
     _lsCityindexStreamingConnection = lsCityindexStreamingConnection;
 }
Exemple #9
0
 public void Setup()
 {
     _mockLsCityindexStreamingConnection = MockRepository.GenerateMock <ILsCityindexStreamingConnection>();
 }
 public NewsStream(ILsCityindexStreamingConnection lsCityindexStreamingConnection)
 {
     _lsCityindexStreamingConnection = lsCityindexStreamingConnection;
 }
 public void Setup()
 {
     _mockLsCityindexStreamingConnection = MockRepository.GenerateMock<ILsCityindexStreamingConnection>();
 }
 public PriceStream(ILsCityindexStreamingConnection lsCityindexStreamingConnection)
 {
     _lsCityindexStreamingConnection = lsCityindexStreamingConnection;
 }
 public PriceStream(ILsCityindexStreamingConnection lsCityindexStreamingConnection)
 {
     _lsCityindexStreamingConnection = lsCityindexStreamingConnection;
 }