コード例 #1
0
        public void Test_Construct(int btsId, byte sectorId, int cellId, bool outdoor, string indoor,
                                   double height, double eTilt, double mTilt, string lac)
        {
            var cell = new CdmaCell
            {
                BtsId     = btsId,
                SectorId  = sectorId,
                CellId    = cellId,
                IsOutdoor = outdoor,
                Height    = height,
                ETilt     = eTilt,
                MTilt     = mTilt,
                Lac       = lac
            };
            var view = CdmaCellView.ConstructView(cell, _repository.Object);

            if (btsId > 0 && btsId <= 3)
            {
                Assert.AreEqual(view.BtsName, "Bts-" + btsId);
            }
            else
            {
                Assert.IsNull(view.BtsName);
            }
            Assert.AreEqual(view.BtsId, btsId);
            Assert.AreEqual(view.SectorId, sectorId);
            Assert.AreEqual(view.CellId, cellId);
            Assert.AreEqual(view.Indoor, indoor);
            Assert.AreEqual(view.Height, height);
            Assert.AreEqual(view.DownTilt, eTilt + mTilt);
            Assert.AreEqual(view.Lac, lac);
        }
コード例 #2
0
        public IEnumerable <CdmaCellView> GetViews(string collegeName)
        {
            var ids   = _repository.GetCdmaCellIds(collegeName);
            var query = ids.Select(_cellRepository.Get).Where(cell => cell != null).ToList();

            return(query.Any()
                ? query.Select(x => CdmaCellView.ConstructView(x, _btsRepository))
                : null);
        }
コード例 #3
0
        public IEnumerable <SectorView> QuerySectors(int btsId)
        {
            var cells = _repository.GetAllList(btsId);

            return(cells.Any()
                ? Mapper.Map <IEnumerable <CdmaCellView>, IEnumerable <SectorView> >(
                       cells.Select(x => CdmaCellView.ConstructView(x, _btsRepository)))
                : new List <SectorView>());
        }
コード例 #4
0
        public IEnumerable <SectorView> QuerySectors(IEnumerable <string> collegeNames)
        {
            var ids =
                collegeNames.Select(x => _repository.GetCdmaCellIds(x)).Aggregate((x, y) => x.Concat(y)).Distinct();
            var query = ids.Select(_cellRepository.Get).Where(cell => cell != null).ToList();

            return(query.Any()
                ? Mapper.Map <IEnumerable <CdmaCellView>, IEnumerable <SectorView> >(
                       query.Select(x => CdmaCellView.ConstructView(x, _btsRepository)))
                : null);
        }
コード例 #5
0
 public static void AssertEqual(this CdmaCellView view, string cellName, double azimuth, string indoor)
 {
     Assert.AreEqual(view.BtsName + "-" + view.SectorId, cellName);
     Assert.AreEqual(view.Azimuth, azimuth);
     Assert.AreEqual(view.Indoor, indoor);
 }