Example #1
0
            public void RestrictToLoseRequirement()
            {
                LoseVersionRequirement loseRequirement;

                // When strictly greater (1.1)
                loseRequirement = new LoseVersionRequirement("1.1");
                Assert.Throws <IncompatibleRequirementException>(
                    delegate
                {
                    requirement.RestrictTo(loseRequirement);
                }
                    );

                // When wider (1.0)
                loseRequirement = new LoseVersionRequirement("1");
                Assert.AreSame(requirement.RestrictTo(loseRequirement), requirement);


                // When lesser (0.9)
                loseRequirement = new LoseVersionRequirement("0.9");
                Assert.Throws <IncompatibleRequirementException>(
                    delegate
                {
                    requirement.RestrictTo(loseRequirement);
                }
                    );
            }
Example #2
0
            public void RestrictToLoseRequirement()
            {
                LoseVersionRequirement loseRequirement;

                // When greater (1.1)
                loseRequirement = new LoseVersionRequirement("1.1");
                Assert.AreSame(requirement.RestrictTo(loseRequirement), loseRequirement);

                // When less detailed (1)
                loseRequirement = new LoseVersionRequirement("1");
                IVersionRequirement targetRequirement = new RangeVersionRequirement("1.0", "2");

                Assert.AreEqual(requirement.RestrictTo(loseRequirement), targetRequirement);

                // When lesser (0.9)
                loseRequirement = new LoseVersionRequirement("0.9");
                Assert.Throws <IncompatibleRequirementException>(
                    delegate
                {
                    requirement.RestrictTo(loseRequirement);
                }
                    );
            }
Example #3
0
            public void RestrictToLoseRequirement()
            {
                LoseVersionRequirement loseRequirement;
                IVersionRequirement    targetRequirement;

                // When greater (4.0)
                loseRequirement = new LoseVersionRequirement("4.0");
                Assert.Throws <IncompatibleRequirementException>(
                    delegate
                {
                    requirement.RestrictTo(loseRequirement);
                }
                    );

                // When in between (2.0)
                loseRequirement = new LoseVersionRequirement("2.0");
                Assert.AreEqual(requirement.RestrictTo(loseRequirement), loseRequirement);

                // When lesser (0.9)
                loseRequirement = new LoseVersionRequirement("0.9");
                Assert.Throws <IncompatibleRequirementException>(
                    delegate
                {
                    requirement.RestrictTo(loseRequirement);
                }
                    );

                // When overlapping bottom
                loseRequirement   = new LoseVersionRequirement("1");
                targetRequirement = new RangeVersionRequirement("1.5", "2");
                Assert.AreEqual(requirement.RestrictTo(loseRequirement), targetRequirement);

                // When overlapping top
                loseRequirement   = new LoseVersionRequirement("3");
                targetRequirement = new RangeVersionRequirement("3", "3.5");
                Assert.AreEqual(requirement.RestrictTo(loseRequirement), targetRequirement);
            }
Example #4
0
            public void RestrictToLoseRequirement()
            {
                LoseVersionRequirement loseRequirement = new LoseVersionRequirement("1.0");

                Assert.AreSame(requirement.RestrictTo(loseRequirement), loseRequirement);
            }