public static VersionConstraint Parse(string value)
        {
            var tokens = value.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            var min    = VersionToken.Find(tokens[0]);

            if (tokens.Length == 1)
            {
                return(new VersionConstraint(min));
            }

            var max = VersionToken.Find(tokens[1]);

            return(new VersionConstraint(min, max));
        }
Example #2
0
 public void gets_the_value()
 {
     var token = new VersionToken("Current", x => new SemanticVersion("1.2.0.0"));
     token.Value(new SemanticVersion("1.0.0.0")).ShouldEqual(new SemanticVersion("1.2.0.0"));
 }
Example #3
0
 protected bool Equals(VersionToken other)
 {
     return string.Equals(_key, other._key);
 }
 public VersionConstraint(VersionToken min, VersionToken max)
 {
     _min = min;
     _max = max;
 }
 public VersionConstraint(VersionToken min)
     : this(min, null)
 {
 }
Example #6
0
 protected bool Equals(VersionToken other)
 {
     return(string.Equals(_key, other._key));
 }
Example #7
0
 public VersionConstraint(VersionToken min, VersionToken max)
 {
     _min = min;
     _max = max;
 }
Example #8
0
 public VersionConstraint(VersionToken min)
     : this(min, null)
 {
 }