예제 #1
0
        public static PBGraph ToPBGraph(this GraphDTO value)
        {
            PBGraph retVal = new PBGraph();

            retVal.VertexMap.AddRange(value.VertexMap.ToPBVertices());
            retVal.SuccessorMap.AddRange(value.SuccessorMap.ToPBIntToMultipleIntMap());
            return(retVal);
        }
예제 #2
0
 public static GraphDTO ToGraph(this PBGraph value)
 {
     //# Tested
     return(new GraphDTO(
                value.VertexMap.ToVertexMap(),
                value.SuccessorMap.ToImmutableDictionary()
                ));
 }
예제 #3
0
        public void PBToDTOGraph()
        {
            GraphDTO dtoStart = Misc.CreateGraphDTO();
            PBGraph  pb       = dtoStart.ToPBGraph();
            GraphDTO dtoEnd   = pb.ToGraph();

            Assert.True(dtoStart.CompareTo(dtoEnd) == 0);
        }