Esempio n. 1
0
 public void Test_AddOneAlarm(short hour, int alarms, string type)
 {
     distribution.Import(new List <AlarmHourInfo>
     {
         new AlarmHourInfo
         {
             Hour      = hour,
             Alarms    = alarms,
             AlarmType = type.GetAlarmType()
         }
     });
     Assert.AreEqual(distribution.AlarmRecords.Count, 1);
     Assert.AreEqual(distribution.AlarmRecords[type][hour], alarms);
 }
        public AlarmHourDistribution GenerateAlarmHourDistribution()
        {
            var stats = _dailyStatRepository.Stats.Select(x =>
                                                          new
            {
                Stat  = x,
                Alarm = x.AlarmHourInfos
            });
            var stat = stats.FirstOrDefault(x =>
                                            x.Stat.StatTime == _statDate && x.Stat.CellId == _cellId && x.Stat.SectorId == _sectorId &&
                                            x.Stat.Frequency == _frequency);
            AlarmHourDistribution distribution = new AlarmHourDistribution();

            if (stat != null)
            {
                distribution.Import(stat.Alarm);
            }
            return(distribution);
        }