Ejemplo n.º 1
0
        public void ConnectingToTheNewsStreamRequiresAValidSession()
        {
            _rpcClient = new Rpc.Client(new Uri("https://ciapipreprod.cityindextest9.co.uk/TradingApi"));
            _rpcClient.LogIn(USERNAME, PASSWORD);

            //Data is streamed over a specific HTTP endpoint
            var STREAMING_URI = new Uri("https://pushpreprod.cityindextest9.co.uk");

            //A single streaming client (connection) allows listening to many streams (channels)
            _streamingClient =
                StreamingClientFactory.CreateStreamingClient(
                    STREAMING_URI, 
                    USERNAME,               /* Note how we use the same username */
                    _rpcClient.Session);  /* and and shared sessionId to connect */

            var gate = new ManualResetEvent(false);
            var isConnected = false;
            //The streaming client raises events when things happen
            _streamingClient.StatusChanged += (object sender, StatusEventArgs e) =>
                                                  {
                                                      if (e.Status.Contains("Connection established"))
                                                      {
                                                          isConnected = true;
                                                          gate.Set();
                                                      }
                                                  };
            //You have to connect the client to the server
            
 
        }
Ejemplo n.º 2
0
        public void ConnectingToTheNewsStreamRequiresAValidSession()
        {
            _rpcClient = new Rpc.Client(new Uri(StaticTestConfig.RpcUrl), new Uri(StaticTestConfig.StreamingUrl), AppKey);
            _rpcClient.LogIn(USERNAME, PASSWORD);

            

            //A single streaming client (connection) allows listening to many streams (channels)
            _streamingClient =
                _rpcClient.CreateStreamingClient();  /* and and shared sessionId to connect */

            var gate = new ManualResetEvent(false);
            var isConnected = false;
            //The streaming client raises events when things happen
            _streamingClient.StatusChanged += (object sender, StatusEventArgs e) =>
                                                  {
                                                      if (e.Status.Contains("Connection established"))
                                                      {
                                                          isConnected = true;
                                                          gate.Set();
                                                      }
                                                  };
            //You have to connect the client to the server
            
 
        }
Ejemplo n.º 3
0
        public void UsingNewsRequiresAValidSession()
        {
            _rpcClient = new Rpc.Client(Settings.RpcUri, Settings.StreamingUri, AppKey);

            _rpcClient.LogIn(USERNAME, PASSWORD);

            KoanAssert.That(_rpcClient.Session, Is.Not.Null.Or.Empty, "after logging in, you should have a valid session");
        }
Ejemplo n.º 4
0
        public void UsingNewsRequiresAValidSession()
        {
            _rpcClient = new Rpc.Client(Settings.RpcUri, Settings.StreamingUri, AppKey);

            _rpcClient.LogIn(USERNAME, PASSWORD);

            KoanAssert.That(_rpcClient.Session, Is.Not.Null.Or.Empty, "after logging in, you should have a valid session");
        }
Ejemplo n.º 5
0
        public void UsingNewsRequiresAValidSession()
        {
            _rpcClient = new Rpc.Client(new Uri("https://ciapipreprod.cityindextest9.co.uk/TradingApi"));

            _rpcClient.LogIn(USERNAME, PASSWORD);

            KoanAssert.That(_rpcClient.Session, Is.Not.Null.Or.Empty, "after logging in, you should have a valid session");
        }
Ejemplo n.º 6
0
        public void ConnectingToTheNewsStreamRequiresAValidSession()
        {
            _rpcClient = new Rpc.Client(Settings.RpcUri, Settings.StreamingUri, AppKey);
            _rpcClient.LogIn(USERNAME, PASSWORD);



            //A single streaming client (connection) allows listening to many streams (channels)
            _streamingClient =
                _rpcClient.CreateStreamingClient();  /* and and shared sessionId to connect */

            var gate = new ManualResetEvent(false);

            //The streaming client raises events when things happen
            _streamingClient.StatusChanged += (object sender, StatusEventArgs e) =>
            {
                if (e.Status.Contains("Connection established"))
                {
                    gate.Set();
                }
            };
            //You have to connect the client to the server
        }