public void Test_GetViews_OneRecord(int collegeId, string statTime, int cellId, byte sectorId, int totalMrs, int secondNeighbors, string begin, string end, bool cellMatched, bool timeMatched) { var kpis = new List <PreciseCoverage4G> { new PreciseCoverage4G { StatTime = DateTime.Parse(statTime), CellId = cellId, SectorId = sectorId, TotalMrs = totalMrs, SecondNeighbors = secondNeighbors } }; _kpiRepository.MockPreciseStats(kpis); var views = _service.GetViews("College-" + collegeId, DateTime.Parse(begin), DateTime.Parse(end)); if (cellMatched) { Assert.AreEqual(views.Count(), 1, "Views"); views.ElementAt(0).AssertBasicParameters(cellId, sectorId, 1.1, 20, "室外", 3.3); if (timeMatched) { Assert.AreEqual(views.ElementAt(0).PreciseRate, totalMrs == 0 ? 100 : 100 - (double)100 * secondNeighbors / totalMrs, 1E-6); } else { Assert.AreEqual(views.ElementAt(0).PreciseRate, 100.0); } } else { Assert.AreEqual(views.Count(), 0); } }
public IEnumerable <CellPreciseKpiView> Get(string collegeName, DateTime begin, DateTime end) { return(_service.GetViews(collegeName, begin, end)); }