Exemple #1
0
        public void routeFromSpec()
        {
            EdgeRouteSpec specAD = new EdgeRouteSpec() { FromNumber = 0, ToNumber = 3 };
            RouteFactory<string> factory = new RouteFactory<string>();
            Assert.Throws<InvalidOperationException>(delegate { factory.newRouteFromSpec(specAD); });
            factory.masterNodeList = list;
            EdgeRoute routeAD = factory.newRouteFromSpec(specAD);
            Assert.AreSame(list.getValueNodesByValue("A").First(), routeAD.startNode);
            Assert.AreSame(list.getValueNodesByValue("D").First(), routeAD.connectedNodes.Last());

            EdgeRouteSpec specCD = (routeCD as EdgeRoute).ToEdgeRouteSpec();
            Assert.AreEqual(2, specCD.FromNumber);
            Assert.AreEqual(3, specCD.ToNumber);
            Assert.AreEqual(0, specCD.RequisiteFromNumber);
        }
Exemple #2
0
 public EdgeRouteSpec ToEdgeRouteSpec()
 {
     EdgeRouteSpec retSpec = new EdgeRouteSpec()
     {
         FromNumber = edge.link.from.SequenceNumber,
         ToNumber = edge.link.to.SequenceNumber,
         RequisiteFromNumber = edge.requisiteLink.from.SequenceNumber,
         RequisiteToNumber = edge.requisiteLink.to.SequenceNumber
     };
     return retSpec;
 }