Exemplo n.º 1
0
        public void TestNewsMap()
        {
            NewsMaker.ClearNewsFolder();
            NewsLocalStorage.ReInstantiate();
            var allNews = MakeSomeNews();

            // проверить карту новостей
            var map = NewsLocalStorage.Instance.MakeNewsMap();

            Assert.AreEqual(allNews.Count, map.channelIds.Length, "TestNewsMap - has all channels");

            // проверить записи на нек. дату
            var chan1News    = allNews[1];
            var someDate     = chan1News[chan1News.Count / 2].Time.Date;
            var newsOnDate   = allNews.Sum(cn => cn.Value.Count(n => n.Time.Date == someDate));
            var recordOnDate = map.records.FirstOrDefault(r => r.date == someDate);

            Assert.AreEqual(newsOnDate, recordOnDate.recordsCount, "TestNewsMap - map is OK on a selected date");
        }
Exemplo n.º 2
0
        public void Setup()
        {
            NewsMaker.ClearNewsFolder();

            fakeTradeServer  = ProxyBuilder.Instance.GetImplementer <ITradeSharpServerTrade>();
            fakeTradeAccount = ProxyBuilder.Instance.GetImplementer <ITradeSharpAccount>();

            Account ac;
            var     methodName = ProxyBuilder.GetMethodName <ITradeSharpAccount>(a => a.GetAccountInfo(1, false, out ac));

            ((IMockableProxy)fakeTradeAccount).MockMethods.Add(methodName,
                                                               new GetAccountInfoDel((int accountId, bool needEquityInfo, out Account account) =>
            {
                account = accounts.FirstOrDefault(a => a.ID == accountId);
                return(RequestStatus.OK);
            }));

            TradeSharpServerTradeProxy.fakeProxy = fakeTradeServer;
        }
Exemplo n.º 3
0
 public void Setup()
 {
     NewsMaker.ClearNewsFolder();
 }