Exemple #1
0
            public void ParseExactRequirement()
            {
                IVersionRequirement parsed = VersionParser.ParseRequirement("1.2.3!");

                Assert.IsTrue(parsed is ExactVersionRequirement);
                Assert.AreEqual((parsed as ExactVersionRequirement).expected, new Version {
                    Major = 1, Minor = 2, Patch = 3
                });
            }
Exemple #2
0
            public void ParseMinimalRequirement()
            {
                IVersionRequirement parsed = VersionParser.ParseRequirement("1.2+");

                Assert.IsTrue(parsed is MinimalVersionRequirement);
                Assert.AreEqual((parsed as MinimalVersionRequirement).minimal, new Version {
                    Major = 1, Minor = 2
                });
            }
Exemple #3
0
            public void ParseBoundedRequirement()
            {
                IVersionRequirement parsed = VersionParser.ParseRequirement("1.2.*");

                Assert.IsTrue(parsed is BoundedVersionRequirement);
                Assert.AreEqual((parsed as BoundedVersionRequirement).lower, new Version {
                    Major = 1, Minor = 2
                });
            }
Exemple #4
0
 public void DoNotParseInvertedRangeRequirement()
 {
     Assert.Throws <System.ArgumentException>(
         delegate
     {
         VersionParser.ParseRequirement("3.4,1.2");
     }
         );
 }
Exemple #5
0
            public void ParseLoseRequirement()
            {
                IVersionRequirement parsed = VersionParser.ParseRequirement("1.2");

                Assert.IsTrue(parsed is LoseVersionRequirement);
                Assert.AreEqual((parsed as LoseVersionRequirement).stub, new Version {
                    Major = 1, Minor = 2
                });
            }
Exemple #6
0
 public void DoNotParseWrongRequirement()
 {
     // QUESTION: Should we not fail there?
     Assert.Throws <System.ArgumentException>(
         delegate
     {
         VersionParser.ParseRequirement("not.a.requirement");
     }
         );
 }
Exemple #7
0
            public void ParseRangeRequirement()
            {
                IVersionRequirement parsed = VersionParser.ParseRequirement("1.2,3.4");

                Assert.IsTrue(parsed is RangeVersionRequirement);
                Assert.AreEqual((parsed as RangeVersionRequirement).lower, new Version {
                    Major = 1, Minor = 2
                });
                Assert.AreEqual((parsed as RangeVersionRequirement).upper, new Version {
                    Major = 3, Minor = 4
                });
            }
Exemple #8
0
        public DependencyNode(string name, string version, string repository, SkipInstallSpec[] skips, OverrideDestinationSpec[] overrides, List <DependencyNode> dependencies)
        {
            this.name         = name;
            this.requirement  = VersionParser.ParseRequirement(version);
            this.repository   = repository;
            this.dependencies = dependencies;
            this.skips        = skips;
            this.overrides    = overrides;

            index   = -1;
            lowlink = -1;
        }
Exemple #9
0
 public void ParseEmptyRequirement()
 {
     Assert.IsTrue(VersionParser.ParseRequirement("") is NoRequirement);
 }