public void TestComparableCell_ThreePoints_SameAzimuth()
        {
            IOutdoorCell[] cl =
            {
                new StubOutdoorCell(new StubGeoPoint(p,  0.02,  30), 225),
                new StubOutdoorCell(new StubGeoPoint(p, 0.01), 225),
                new StubOutdoorCell(new StubGeoPoint(p,  0.03,  35), 225)
            };
            cellList = p.GenerateComparableCellList(cl).Select(FakeComparableCell.Parse).ToArray();

            Assert.AreEqual(cellList[0].AzimuthAngle, 15, eps);
            Assert.AreEqual(cellList[1].AzimuthAngle, 45, eps);
            Assert.AreEqual(cellList[2].AzimuthAngle, 10, eps);

            Array.Sort(cellList);
            Assert.AreEqual(cellList[0].AzimuthAngle, 45, eps);
            Assert.AreEqual(cellList[0].MetricCalculate(), 8.248211, eps, "_cellList[0]'s metric: "
                            + cellList[0].MetricCalculate());
            Assert.AreEqual(cellList[1].AzimuthAngle, 15, eps);
            Assert.AreEqual(cellList[1].MetricCalculate(), 12.501933, eps, "_cellList[1]'s metric: "
                            + cellList[1].MetricCalculate());
            Assert.AreEqual(cellList[2].AzimuthAngle, 10, eps);
            Assert.AreEqual(cellList[2].MetricCalculate(), 18.340954, eps, "_cellList[2]'s metric: "
                            + cellList[2].MetricCalculate());
        }
        public void TestTwoPoints_SamePoint()
        {
            IGeoPoint <double> op = new StubGeoPoint(p, 0.01, 45);

            IOutdoorCell[] cl =
            {
                new StubOutdoorCell(op, 180),
                new StubOutdoorCell(op, 225)
            };
            cellList = p.GenerateComparableCellList(cl).Select(FakeComparableCell.Parse).ToArray();
            Array.Sort(cellList);
            Assert.AreEqual(cellList[0].AzimuthAngle, 0, eps);
            Assert.AreEqual(cellList[1].AzimuthAngle, 45, eps);

            cellList[0].SetAzimuthAngle(p, 135);
            cellList[1].SetAzimuthAngle(p, 90);
            Array.Sort(cellList);
            Assert.AreEqual(cellList[0].AzimuthAngle, 135, eps);
            Assert.AreEqual(cellList[0].MetricCalculate(), 31.612974, eps, cellList[0].MetricCalculate().ToString(CultureInfo.InvariantCulture));
            Assert.AreEqual(cellList[1].AzimuthAngle, 90, eps);
            Assert.AreEqual(cellList[1].MetricCalculate(), 31.612974, eps, cellList[1].MetricCalculate().ToString(CultureInfo.InvariantCulture));
        }