public void Run()
        {
            //// Arrange

            var stream1 = new MarketDataStream();

            var aggregator = new ThrottledMarketDataStream();

            stream1.AddWatcher(aggregator);

            var client = new Client();

            aggregator.AddWatcher(client);

            //// Act
            aggregator.Start();
            stream1.Start();

            Thread.Sleep(3000);

            stream1.End();

            Thread.Sleep(3000);

            //// Assert
        }
Beispiel #2
0
        public void Run()
        {
            //// Arrange

            var aggregator = new ThrottledMarketDataStream();
            var streams    = new List <MarketDataStream>();
            var client     = new Client();

            for (var i = 0; i < 1000; i++)
            {
                var stream = new MarketDataStream();
                stream.AddWatcher(aggregator);
                streams.Add(stream);
            }

            aggregator.AddWatcher(client);

            //// Act
            aggregator.Start();

            foreach (var stream in streams)
            {
                stream.Start();
            }

            Thread.Sleep(10000);

            foreach (var stream in streams)
            {
                stream.End();
            }

            aggregator.End();

            //// Assert
        }