Esempio n. 1
0
        public void TestTopDrop2GCellCsv_MainRssiHourInfo()
        {
            MainRssiHourInfo info
                = stats[8].GenerateHourInfo <MainRssiHourInfo, double>();

            info.AssertHourTest(new[] {
                -84, -84, -85, -85, -85, -84.5, -85, -84, -83.5, -82, -80.5, -80, -80, -80.5, -80.5, -80, -80, -80, -80.5, -81, -81.5, -81, -81.5, -82
            });
        }
        public void Test_GenerateCoverageInterferenceDistribution_MainRssiHourInfo(
            double[] values)
        {
            MainRssiHourInfo info = new MainRssiHourInfo
            {
                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,
                MainRssiHourInfo = 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].MainRssi, values[i]);
            }
        }
 public void Test_GenerateCoverageInterferenceDistribution_MainRssiHourInfo(
     double[] values)
 {
     MainRssiHourInfo info = new MainRssiHourInfo
     {
         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,
         MainRssiHourInfo = 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].MainRssi, values[i]);
     }
 }
Esempio n. 4
0
 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)
         });
     }
 }