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));
        }
 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"));
 }
Exemple #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)
 {
 }
Exemple #6
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)
 {
 }