public void TestTopDrop2GCellCsv_DropEcioHourInfo() { DropEcioHourInfo info = stats[1].GenerateHourInfo <DropEcioHourInfo, double>(); info.AssertHourTest(new[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -10.2, -9.2, -8.3, -9.1, -8.7, -10.0, -9.2, -9.2, -8.6, -9.9, -13.6, -9.6, -9.3, -8.6, -4.5 }); }
public void Test_GenerateCoverageInterferenceDistribution_DropEcioHourInfo( double[] values) { DropEcioHourInfo info = new DropEcioHourInfo { Hour0Info = values[0], Hour1Info = values[1], Hour2Info = values[2], Hour3Info = values[3], Hour4Info = values[4], Hour5Info = values[5], Hour6Info = values[6], Hour7Info = values[7], Hour8Info = values[8], Hour9Info = values[9], Hour10Info = values[10], Hour11Info = values[11], Hour12Info = values[12], Hour13Info = values[13], Hour14Info = values[14], Hour15Info = values[15], Hour16Info = values[16], Hour17Info = values[17], Hour18Info = values[18], Hour19Info = values[19], Hour20Info = values[20], Hour21Info = values[21], Hour22Info = values[22], Hour23Info = values[23] }; statList.Add(new TopDrop2GCellDaily { CellId = 1, SectorId = 2, Frequency = 3, StatTime = DateTime.Today, DropEcioHourInfo = info }); mockRepository.SetupGet(x => x.Stats).Returns(statList.AsQueryable()); List <CoverageInterferenceDistribution> distribution = _service.GenerateCoverageInterferenceDistribution(); Assert.AreEqual(distribution.Count, 24); for (int i = 0; i < 24; i++) { Assert.AreEqual(distribution[i].DropEcio, values[i]); } }
public void Test_GenerateCoverageInterferenceDistribution_DropEcioHourInfo( double[] values) { DropEcioHourInfo info = new DropEcioHourInfo { Hour0Info = values[0], Hour1Info = values[1], Hour2Info = values[2], Hour3Info = values[3], Hour4Info = values[4], Hour5Info = values[5], Hour6Info = values[6], Hour7Info = values[7], Hour8Info = values[8], Hour9Info = values[9], Hour10Info = values[10], Hour11Info = values[11], Hour12Info = values[12], Hour13Info = values[13], Hour14Info = values[14], Hour15Info = values[15], Hour16Info = values[16], Hour17Info = values[17], Hour18Info = values[18], Hour19Info = values[19], Hour20Info = values[20], Hour21Info = values[21], Hour22Info = values[22], Hour23Info = values[23] }; statList.Add(new TopDrop2GCellDaily { CellId = 1, SectorId = 2, Frequency = 3, StatTime = DateTime.Today, DropEcioHourInfo = info }); mockRepository.Setup(x => x.GetAll()).Returns(statList.AsQueryable()); List<CoverageInterferenceDistribution> distribution = _service.GenerateCoverageInterferenceDistribution(); Assert.AreEqual(distribution.Count, 24); for (int i = 0; i < 24; i++) { Assert.AreEqual(distribution[i].DropEcio, values[i]); } }
public static void Import(this List<CoverageInterferenceDistribution> result, DropEcioHourInfo dropEcioInfo, MainRssiHourInfo mainRssiInfo, SubRssiHourInfo subRssiInfo) { for (int hour = 0; hour < 24; hour++) { string propertyName = "Hour" + hour + "Info"; PropertyInfo dropEcioProperty = (typeof(DropEcioHourInfo)).GetProperty(propertyName); PropertyInfo mainRssiProperty = (typeof(MainRssiHourInfo)).GetProperty(propertyName); PropertyInfo subRssiProperty = (typeof(SubRssiHourInfo)).GetProperty(propertyName); result.Add(new CoverageInterferenceDistribution { Hour = hour, DropEcio = (dropEcioInfo == null) ? 0 : (double)dropEcioProperty.GetValue(dropEcioInfo), MainRssi = (mainRssiInfo == null) ? 0 : (double)mainRssiProperty.GetValue(mainRssiInfo), SubRssi = (subRssiInfo == null) ? 0 : (double)subRssiProperty.GetValue(subRssiInfo) }); } }