public void IsMonotonic_Invalid()
        {
            // Has a non-zero patch component
            var m0 = new SemanticVersion(2, 5, 1);
            // Has pre-release identifier components
            var m1 = new SemanticVersion(1, 0, 0, new[] { "abc" });
            // Is null.
            var m2 = (SemanticVersion)null;

            Assert.IsFalse(m0.IsMonotonic());
            Assert.IsFalse(m1.IsMonotonic());

            new Action(() => m2.IsMonotonic())
                .AssertThrows<ArgumentNullException>();
        }
Exemplo n.º 2
0
        public void IsMonotonic_Invalid()
        {
            // Has a non-zero patch component
            var m0 = new SemanticVersion(2, 5, 1);
            // Has pre-release identifier components
            var m1 = new SemanticVersion(1, 0, 0, new[] { "abc" });
            // Is null.
            var m2 = (SemanticVersion)null;

            Assert.IsFalse(m0.IsMonotonic());
            Assert.IsFalse(m1.IsMonotonic());

            new Action(() => m2.IsMonotonic())
            .AssertThrows <ArgumentNullException>();
        }
        public void IsMonotonic_Valid()
        {
            // A semantic version is a valid monotonic version if it:
            //      a) Has a patch component of zero; and
            //      b) Has no pre-release identifiers.
            //
            // If either of these conditions is not fulfilled, a semantic
            // version is not a valid monotonic version.

            var m0 = new SemanticVersion(1, 2);
            var m1 = new SemanticVersion(1, 0, 0, new string[0], new[] { "x" });

            Assert.IsTrue(m0.IsMonotonic());
            Assert.IsTrue(m1.IsMonotonic());
        }
Exemplo n.º 4
0
        public void IsMonotonic_Valid()
        {
            // A semantic version is a valid monotonic version if it:
            //      a) Has a patch component of zero; and
            //      b) Has no pre-release identifiers.
            //
            // If either of these conditions is not fulfilled, a semantic
            // version is not a valid monotonic version.

            var m0 = new SemanticVersion(1, 2);
            var m1 = new SemanticVersion(1, 0, 0, new string[0], new[] { "x" });

            Assert.IsTrue(m0.IsMonotonic());
            Assert.IsTrue(m1.IsMonotonic());
        }