private void AddToWptListCase2And4(WaypointList wptList) { var entry = new StarEntry( "18", "STAR1", List(wpt101, wpt102, wpt103, wpt104), EntryType.RwySpecific); var adder = new StarAdder( "AXYZ", new StarCollection(List(entry)), wptList, wptList.GetEditor(), GetAirportManager()); int rwyIndex = adder.AddStarsToWptList("18", List("STAR1")); // Check the STAR1 has been added with correct total distance. var edges = wptList.EdgesTo(rwyIndex).ToList(); Assert.IsTrue(edges.Count > 0); Assert.IsTrue(edges .Select(e => wptList.GetEdge(e)) .All(e => e.Value.InnerWaypoints.SequenceEqual(List(wpt102, wpt103, wpt104)) && e.Value.Type == InnerWaypointsType.Terminal)); double dis = List(wpt101, wpt102, wpt103, wpt104, rwy) .TotalDistance(); Assert.IsTrue(StarIsAdded( wptList.FindByWaypoint(wpt101), "STAR1", dis, wptList)); // Check the edges of first wpt int index = wptList.FindByWaypoint(wpt101); Assert.IsTrue(index >= 0); Assert.AreEqual(2, wptList.EdgesToCount(index)); foreach (var i in wptList.EdgesTo(index)) { var edge = wptList.GetEdge(i); Assert.AreEqual("DCT", edge.Value.Airway); Assert.AreEqual(0, edge.Value.InnerWaypoints.Count); double expectedDis = wpt101.Distance(wptList[edge.FromNodeIndex]); Assert.AreEqual(expectedDis, edge.Value.Distance, DistanceEpsilon); } }