public void Test_TwoStats_OneMatchDateRange_WithDifferentTowns(string[] statDates,
                                                                       int[] townIds, int mrs, int neighbors, string begin,
                                                                       string end,
                                                                       string district)
        {
            cellRepository.SetupGet(x => x.Stats).Returns(new List <TownPreciseCoverage4GStat>
            {
                new TownPreciseCoverage4GStat
                {
                    StatTime        = DateTime.Parse(statDates[0]),
                    TownId          = townIds[0],
                    TotalMrs        = mrs,
                    SecondNeighbors = neighbors
                },
                new TownPreciseCoverage4GStat
                {
                    StatTime        = DateTime.Parse(statDates[1]),
                    TownId          = townIds[1],
                    TotalMrs        = mrs,
                    SecondNeighbors = neighbors
                }
            }.AsQueryable());
            QueryLteStatController queryController = new QueryLteStatController(cellRepository.Object,
                                                                                townRepository.Object);

            Assert.AreEqual(queryController.Get(DateTime.Parse(begin), DateTime.Parse(end)), 1);
            Assert.AreEqual(KpiStatContainer.AllLteDailyStatList.Stats.Count(), 1);
            AssertValuesWithOneDistrictAndTown(statDates[0], townIds[0], mrs, neighbors, district);
        }
        public void Test_TwoStats_BothMatchDateRange_WithDifferentMrs(string[] statDates,
                                                                      int townId, int[] mrs, int neighbors, string begin,
                                                                      string end,
                                                                      string district)
        {
            cellRepository.SetupGet(x => x.Stats).Returns(new List <TownPreciseCoverage4GStat>
            {
                new TownPreciseCoverage4GStat
                {
                    StatTime        = DateTime.Parse(statDates[0]),
                    TownId          = townId,
                    TotalMrs        = mrs[0],
                    SecondNeighbors = neighbors
                },
                new TownPreciseCoverage4GStat
                {
                    StatTime        = DateTime.Parse(statDates[1]),
                    TownId          = townId,
                    TotalMrs        = mrs[1],
                    SecondNeighbors = neighbors
                }
            }.AsQueryable());
            QueryLteStatController queryController = new QueryLteStatController(cellRepository.Object,
                                                                                townRepository.Object);

            Assert.AreEqual(queryController.Get(DateTime.Parse(begin), DateTime.Parse(end)), 1);
            Assert.AreEqual(KpiStatContainer.AllLteDailyStatList.Stats.Count(), 1);
            IEnumerable <string> dates = (new QueryLteDistrictDatesController()).Get(district);

            Assert.AreEqual(dates.Count(), 2, "dates count");
            Assert.AreEqual(dates.ElementAt(0), DateTime.Parse(statDates[0]).ToShortDateString());
            Assert.AreEqual(dates.ElementAt(1), DateTime.Parse(statDates[1]).ToShortDateString());
            IEnumerable <int> mrList = (new QueryLteMrsController()).Get(district);

            Assert.AreEqual(mrList.Count(), 2, "District Mr List Count");
            Assert.AreEqual(mrList.ElementAt(0), mrs[0]);
            Assert.AreEqual(mrList.ElementAt(1), mrs[1]);
            IEnumerable <double> rates = (new QueryPreciseRatesController()).Get(district);

            Assert.AreEqual(rates.Count(), 2);
            Assert.AreEqual(rates.ElementAt(0), (double)100 * (mrs[0] - neighbors) / mrs[0], 1E-6);
            Assert.AreEqual(rates.ElementAt(1), (double)100 * (mrs[1] - neighbors) / mrs[1], 1E-6);
            string town = "T-" + townId;
            IEnumerable <string> towns = (new QueryLteKpiTownListController()).Get(district);

            Assert.AreEqual(towns.Count(), 1);
            Assert.AreEqual(towns.ElementAt(0), town);
            mrList = (new QueryLteMrsController()).Get(district, town);
            Assert.AreEqual(mrList.Count(), 2);
            Assert.AreEqual(mrList.ElementAt(0), mrs[0]);
            Assert.AreEqual(mrList.ElementAt(1), mrs[1]);
            rates = (new QueryPreciseRatesController()).Get(district, town);
            Assert.AreEqual(rates.Count(), 2);
            Assert.AreEqual(rates.ElementAt(0), (double)100 * (mrs[0] - neighbors) / mrs[0], 1E-6);
            Assert.AreEqual(rates.ElementAt(1), (double)100 * (mrs[1] - neighbors) / mrs[1], 1E-6);
        }