예제 #1
0
        private static void TestSSE(IIEXCloudClient client)
        {
            var eventSource = client.CreateTradeEventSource("aapl", "SNAP", "fb");

            eventSource.Events += LogTradeEvent;
            Thread.Sleep(100000);
            eventSource.Events -= LogTradeEvent;
        }
예제 #2
0
        public void TestTradeEvents()
        {
            var eventSource   = client.CreateTradeEventSource(Symbol);
            var eventReceived = false;

            eventSource.Events += (sender, eventArg) => {
                Console.WriteLine(eventArg.Price);
                eventReceived = true;
            };
            for (int i = 0; i < 10; i++)
            {
                if (eventReceived)
                {
                    return; //we don't reach the fail below
                }
                Thread.Sleep(1000);
            }
            Assert.Fail("no trade event received");
        }