예제 #1
0
        private async void Import(StreamReader reader, int count, string[] carries)
        {
            result = await importer.ImportStat(reader, CsvFileDescription.CommaDescription);

            Assert.AreEqual(result, count);
            Assert.AreEqual(statRepository.Object.Stats.Count(), count);
            for (int i = 0; i < count; i++)
            {
                TopDrop2GCellDaily stat   = statRepository.Object.Stats.ElementAt(i);
                string[]           fields = carries[i].GetSplittedFields('_');
                Assert.AreEqual(stat.BscId, short.Parse(fields[0]));
                Assert.AreEqual(stat.BtsId, int.Parse(fields[1]));
                Assert.AreEqual(stat.CellId, int.Parse(fields[2]));
                Assert.AreEqual(stat.SectorId, byte.Parse(fields[3]));
                Assert.AreEqual(stat.Frequency, short.Parse(fields[4]));
            }
        }
        public void Test_QueryStat_CdrDrops(int cdrDrops, int kpiDrops)
        {
            statList.Add(new TopDrop2GCellDaily
            {
                CellId    = 1,
                SectorId  = 2,
                Frequency = 3,
                StatTime  = DateTime.Today,
                CdrDrops  = cdrDrops,
                KpiDrops  = kpiDrops
            });
            mockRepository.SetupGet(x => x.Stats).Returns(statList.AsQueryable());
            TopDrop2GCellDaily stat = _service.QueryStat();

            Assert.AreEqual(stat.CdrDrops, cdrDrops);
            Assert.AreEqual(stat.KpiDrops, kpiDrops);
        }
예제 #3
0
        public void TestTopDrop2GCellCsv_ImportCsvStat()
        {
            string             carrierInfo = stats[0].Carrier;
            TopDrop2GCellDaily stat        = new TopDrop2GCellDaily();

            stat.ImportCarrierInfo(carrierInfo.GetSplittedFields('_'));
            int beginIndex = 0;

            Assert.AreEqual(stat.Import(stats, ref beginIndex, carrierInfo), "1_1377_1377_0_201");
            Assert.AreEqual(beginIndex, 10);
            Assert.AreEqual(stat.MainRssi, -82.0851);
            Assert.AreEqual(stat.AverageRssi, -85);
            Assert.AreEqual(stat.KpiCalls, 5672);
            stat.SubRssiHourInfo.AssertHourTest(new double[] {
                -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109
            });
            stat.ErasureDropsHourInfo.AssertHourTest(new[] {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 18, 19, 13, 7, 15, 10, 19, 11, 13, 6, 10, 4, 4, 3
            });
            Assert.IsNull(stat.DropCause);
        }