Ejemplo n.º 1
0
        void Run()
        {
            var tmp = new List <StatItem>();
            var r   = new Random(1);

            while (true)
            {
                tmp.Clear();
                Statistic.Clear();
                tmp = MonitorManager.GetCurrencyStatictic(TickPeriod.ToInt(), ConnectionString);

                Statistic.Add(GetByCurr(tmp, CurrencyTypeEnum.RUB));
                Statistic.Add(GetByCurr(tmp, CurrencyTypeEnum.USD));
                Statistic.Add(GetByCurr(tmp, CurrencyTypeEnum.EUR));
                Statistic.Add(GetByCurr(tmp, CurrencyTypeEnum.CHF));
                Statistic.Add(GetByCurr(tmp, CurrencyTypeEnum.JPY));
                Statistic.Add(GetByCurr(tmp, CurrencyTypeEnum.GBP));
                Statistic.Add(GetByCurr(tmp, CurrencyTypeEnum.CAD));
                Statistic.Add(GetByCurr(tmp, CurrencyTypeEnum.CNY));
                Statistic.Add(GetByCurr(tmp, CurrencyTypeEnum.BRL));

                ClearStatServer();

                StatServer = MonitorManager.GetServerStatictic(TickPeriod.ToInt(), ConnectionString);

                RiseShowValueAndPriceEvent();
                Thread.Sleep(TickPeriod.ToInt());
            }
        }
Ejemplo n.º 2
0
        public void MonitorTest()
        {
            var _clist = new List <CurrencyTypeEnum>
            {
                CurrencyTypeEnum.RUB,
                CurrencyTypeEnum.USD,
                CurrencyTypeEnum.EUR,
                CurrencyTypeEnum.CHF,
                CurrencyTypeEnum.JPY,
                CurrencyTypeEnum.GBP,
                CurrencyTypeEnum.CAD,
                CurrencyTypeEnum.CNY,
                CurrencyTypeEnum.BRL
            };

            var list = MonitorManager.GetCurrencyStatictic(5000, _cs);

            Assert.IsTrue(list.Count == _clist.Count);
        }