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); }
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); }
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>()); }
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); }
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); }