public void TestComparableCell_TwoPoints_WithDifferentCells_SameBudget() { Mock <IOutdoorCell> outdoorCell1 = new Mock <IOutdoorCell>(); outdoorCell1.MockOutdoorCell(112, 23, 0, 15.2, 18); Mock <IOutdoorCell> outdoorCell2 = new Mock <IOutdoorCell>(); outdoorCell2.MockOutdoorCell(112.5, 23, 0, 15.2, 18); StubGeoPoint point1 = new StubGeoPoint(outdoorCell1.Object, 0.01); StubGeoPoint point2 = new StubGeoPoint(outdoorCell2.Object, 0.01, 90); ComparableCell comparableCell1 = new ComparableCell(point1, outdoorCell1.Object, budgetList, model); Assert.AreEqual(comparableCell1.Cell, outdoorCell1.Object); Assert.AreEqual(comparableCell1.Distance, 1.111949, eps); Assert.AreEqual(comparableCell1.AzimuthAngle, 90); ComparableCell comparableCell2 = new ComparableCell(point2, outdoorCell2.Object, budgetList, model); Assert.AreEqual(comparableCell2.Cell, outdoorCell2.Object); Assert.AreEqual(comparableCell2.Distance, 1.111949, eps); Assert.AreEqual(comparableCell2.AzimuthAngle, 0); Assert.AreEqual(budgetList.Count, 1); Assert.AreEqual(budgetList.ElementAt(0), comparableCell1.Budget); Assert.AreEqual(budgetList.ElementAt(0), comparableCell2.Budget); }
public void TestGenerateMeasurableCellList_TwoCells_InOneStation() { Mock <IOutdoorCell> outdoorCell1 = new Mock <IOutdoorCell>(); outdoorCell1.MockOutdoorCell(112, 23, 0, 15.2, 18); Mock <IOutdoorCell> outdoorCell2 = new Mock <IOutdoorCell>(); outdoorCell2.MockOutdoorCell(112, 23, 45, 15.2, 18); compCells = new ComparableCell[2]; compCells[0] = new ComparableCell(1.111949, 45) { Budget = new LinkBudget(model), Cell = outdoorCell2.Object }; compCells[1] = new ComparableCell(1.111949, 90) { Budget = new LinkBudget(model), Cell = outdoorCell1.Object }; measurablePoint.CellRepository.GenerateMeasurableCellList(compCells, measurablePoint); Assert.AreEqual(measurablePoint.CellRepository.CellList.Count, 2); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].Cell, compCells[0]); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].Budget, compCells[0].Budget); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].ReceivedRsrp, -113.512676, eps); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].TiltAngle, 2.939795, eps); Assert.AreEqual(measurablePoint.CellRepository.CellList[1].ReceivedRsrp, -136.877439, eps); Assert.AreEqual(measurablePoint.CellRepository.CellList[1].TiltAngle, 2.939795, eps); }
public void TestComparableCell_ConstructTwoPoints_WithDifferentCells_SameBudget() { StubOutdoorCell cell1 = new StubOutdoorCell(112, 23) { RsPower = 15.2, Pci = 30, AntennaGain = 17.5, Frequency = 100 }; StubOutdoorCell cell2 = new StubOutdoorCell(112.5, 23) { RsPower = 15.2, Pci = 30, AntennaGain = 17.5, Frequency = 100 }; StubGeoPoint point1 = new StubGeoPoint(cell1, 0.01); StubGeoPoint point2 = new StubGeoPoint(cell2, 0.01, 90); ComparableCell comparableCell1 = new ComparableCell(point1, cell1, budgetList); Assert.AreEqual(comparableCell1.Cell, cell1); Assert.AreEqual(comparableCell1.Distance, 1.111949, eps); Assert.AreEqual(comparableCell1.AzimuthAngle, 90); Assert.AreEqual(budgetList.Count, 1); Assert.AreEqual(budgetList.ElementAt(0), comparableCell1.Budget); ComparableCell comparableCell2 = new ComparableCell(point2, cell2, budgetList); Assert.AreEqual(comparableCell2.Cell, cell2); Assert.AreEqual(comparableCell2.Distance, 1.111949, eps); Assert.AreEqual(comparableCell2.AzimuthAngle, 0); Assert.AreEqual(budgetList.Count, 1); Assert.AreEqual(budgetList.ElementAt(0), comparableCell2.Budget); }
public void TestGenerateMeasurableCellList_OneCell() { Mock <IOutdoorCell> outdoorCell = new Mock <IOutdoorCell>(); outdoorCell.MockOutdoorCell(112, 23, 0, 15.2, 18); compCells = new ComparableCell[1]; compCells[0] = new ComparableCell(1.111949, 90) { Budget = new LinkBudget(model), Cell = outdoorCell.Object }; measurablePoint.CellRepository.GenerateMeasurableCellList(compCells, measurablePoint); Assert.AreEqual(measurablePoint.CellRepository.CellList.Count, 1); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].Cell, compCells[0]); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].Budget, compCells[0].Budget); Assert.AreEqual(FakeComparableCell.Parse(measurablePoint.CellRepository.CellList[0].Cell).MetricCalculate(), 31.61297, eps); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].Cell.AzimuthFactor(), 30, eps); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].Budget.AntennaGain, 18); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].Budget.TransmitPower, 15.2); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].Cell.Cell.Height, 40); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].TiltFactor(), 1.259912, eps); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].ReceivedRsrp, -136.877439, eps); Assert.AreEqual(measurablePoint.CellRepository.CellList[0].TiltAngle, 2.939795, eps); }
private void TestInitialize(double distance) { point2 = new StubGeoPoint(point, distance, 45); ocell = new StubOutdoorCell(point2, 225); ocell.Height = 40; ocell.ETilt = 4; ocell.MTilt = 1; ccell = new ComparableCell(point, ocell); cell = new MeasurableCell(ccell, point, budget); }
private void TestInitialize(double distance) { _point2 = new StubGeoPoint(point, distance, 45); _ocell = new StubOutdoorCell(_point2, 195) { Height = 40, ETilt = 4, MTilt = 1 }; _ccell = new ComparableCell(point, _ocell); _cell = new MeasurableCell(_ccell, point, budget); }
public static FakeComparableCell Parse(ComparableCell cell) { return(new FakeComparableCell() { Cell = cell.Cell, AzimuthAngle = cell.AzimuthAngle, Budget = cell.Budget, Distance = cell.Distance, PciModx = cell.PciModx }); }
public static ComparableCell[] GenerateComparableCellList(this IGeoPoint <double> p, IOutdoorCell[] cl) { int length = cl.Length; ComparableCell[] ccl = new ComparableCell[length]; for (int i = 0; i < length; i++) { ccl[i] = new ComparableCell(p, cl[i]); } return(ccl); }
public void SetUp() { p = new Mock <IGeoPoint <double> >(); p.SetupGet(x => x.Longtitute).Returns(112); p.SetupGet(x => x.Lattitute).Returns(23); cell = new Mock <IOutdoorCell>(); cell.SetupGet(x => x.Longtitute).Returns(112.01); cell.SetupGet(x => x.Lattitute).Returns(23.01); cell.BindGetAndSetAttributes(x => x.Azimuth, (x, v) => x.Azimuth = v); cc = new ComparableCell { Cell = cell.Object }; }
public void TestComparableCell_OnePoint() { Mock <IOutdoorCell> outdoorCell = new Mock <IOutdoorCell>(); outdoorCell.MockOutdoorCell(112, 23, 0, 15.2, 18); StubGeoPoint point = new StubGeoPoint(outdoorCell.Object, 0.01); ComparableCell comparableCell = new ComparableCell(point, outdoorCell.Object, budgetList, model); Assert.AreEqual(comparableCell.Cell, outdoorCell.Object); Assert.AreEqual(comparableCell.Distance, 1.111949, eps); Assert.AreEqual(comparableCell.AzimuthAngle, 90); Assert.AreEqual(comparableCell.Budget.AntennaGain, 18); Assert.AreEqual(comparableCell.Budget.TransmitPower, 15.2); Assert.AreEqual(budgetList.Count, 1); Assert.AreEqual(budgetList.ElementAt(0), comparableCell.Budget); }
public void TestComparableCell_ConstructOnePoint() { StubOutdoorCell cell = new StubOutdoorCell(112, 23) { RsPower = 15.2, Pci = 30, AntennaGain = 17.5, Frequency = 100 }; StubGeoPoint point = new StubGeoPoint(cell, 0.01); ComparableCell comparableCell = new ComparableCell(point, cell, budgetList); Assert.AreEqual(comparableCell.Cell, cell); Assert.AreEqual(comparableCell.Distance, 1.111949, eps); Assert.AreEqual(comparableCell.AzimuthAngle, 90); Assert.AreEqual(comparableCell.Budget.AntennaGain, 17.5); Assert.AreEqual(comparableCell.Budget.TransmitPower, 15.2); Assert.AreEqual(comparableCell.PciModx, 0); Assert.AreEqual(budgetList.Count, 1); Assert.AreEqual(budgetList.ElementAt(0), comparableCell.Budget); }
public static void SetupComparableCellProperties(this ComparableCell mockCC, double distance, double azimuthAngle) { mockCC.Distance = distance; mockCC.AzimuthAngle = azimuthAngle; }
public void TestComparableCell_OneCell_Distance() { ComparableCell c = new ComparableCell(0.5, 0); Assert.AreEqual(c.Distance, 0.5); }