Example #1
0
        public void _05_DailyTradePeriodTest()
        {
            var service = new TradingInfoService();
            var pairs   = service.GetAvailablePeriods(Code, new DateTime(2018, 6, 27), new DateTime(2017, 4, 5)).ToArray();

            Assert.AreEqual(5, pairs.Count());
        }
Example #2
0
        public void _02_DailyTradePeriodTest()
        {
            var service = new TradingInfoService();
            var years   = service.GetAvailablePeriods(Code).ToArray();

            var count = Convert.ToInt32(Math.Ceiling(DateTime.Today.Month / 3.0));

            Assert.AreEqual(count, years.Count());
        }
Example #3
0
        public IEnumerable <TradingInfo> GetDailyTadingInfo(string codeShort, DateTime?end = null, DateTime?begin = null)
        {
            var periods = _tradeService.GetAvailablePeriods(codeShort, end, begin).ToArray();

            return(periods.SelectMany(period =>
            {
                return _tradeService.GetDailyTadingInfo(codeShort, period.Item1, period.Item2).ToArray();
            }));
        }
Example #4
0
        public void _04_DailyTradePeriodTest()
        {
            var service = new TradingInfoService();
            var pairs   = service.GetAvailablePeriods(Code, new DateTime(2017, 12, 31), new DateTime(2017, 1, 1)).ToArray();

            int beginYear = 2017;
            int endYear   = 2017;

            Assert.AreEqual(4, pairs.Count());
        }