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"); }
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; }
public void Setup() { NewsMaker.ClearNewsFolder(); }