예제 #1
0
        public void Test_GetAverageRates(int testNo,
                                         int[] collegeIds, string[] testDates, int hour, double[] rates,
                                         string begin, string end, int resultNum)
        {
            _repository.MockRateItems(collegeIds, testDates.Select(x => DateTime.Parse(x).AddHours(hour)).ToArray(), rates);

            var result = _service.GetAverageRates(DateTime.Parse(begin), DateTime.Parse(end));

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count, resultNum);
            for (var i = 0; i < result.Count; i++)
            {
                Console.WriteLine("Average Rate[{0}]: {1}", result.ElementAt(i).Key, result[result.ElementAt(i).Key]);
            }
        }
예제 #2
0
 public Dictionary <string, double> Get(DateTime begin, DateTime end)
 {
     return(_service.GetAverageRates(begin, end));
 }