示例#1
0
        public void PBToDTOSemanticVersion()
        {
            SemanticVersionDTO dtoStart = Misc.CreateSemanticVersionDTO;
            PBSemanticVersion  pb       = dtoStart.ToPBSemanticVersion();
            SemanticVersionDTO dtoEnd   = pb.ToSemanticVersion();

            Assert.True(dtoStart.CompareTo(dtoEnd) == 0);
        }
示例#2
0
 public static SemanticVersionDTO ToSemanticVersion(this PBSemanticVersion c)
 {
     //# Tested
     return(new SemanticVersionDTO(
                c.PublicId.ToPublicId(),
                c.Stamp.ToStamp(),
                c.FieldValues.ToObjects().ToImmutableArray()
                ));
 }
示例#3
0
        public static PBSemanticVersion ToPBSemanticVersion(this SemanticVersionDTO c)
        {
            //# Tested
            PBSemanticVersion retVal = new PBSemanticVersion
            {
                PublicId = c.PublicId.ToPBPublicId(),
                Stamp    = c.Stamp.ToPBStamp(),
            };

            retVal.FieldValues.AddRange(c.Fields.ToPBFields());
            return(retVal);
        }
示例#4
0
        public static PBSemanticChronology ToPBSemanticChronology(this SemanticChronologyDTO c)
        {
            //# Tested
            PBSemanticChronology retVal = new PBSemanticChronology
            {
                PublicId            = c.PublicId.ToPBPublicId(),
                PatternForSemantic  = c.PatternForSemantic.ToPBPublicId(),
                ReferencedComponent = c.ReferencedComponentPublicId.ToPBPublicId()
            };

            PBSemanticVersion[] versions = new PBSemanticVersion[c.Versions.Length];
            for (Int32 i = 0; i < c.Versions.Length; i++)
            {
                versions[i] = c.Versions[i].ToPBSemanticVersion();
            }
            retVal.Versions.AddRange(versions);

            return(retVal);
        }