Example #1
0
        public void InvalidVersionString(string input)
        {
            TestDelegate testDelegate = new TestDelegate(() => {
                var semver = new SematicVersion(input);
            });

            Assert.Catch(testDelegate);
        }
Example #2
0
        public int Compare(string a, string b)
        {
            var sem1     = new SematicVersion(a);
            var sem2     = new SematicVersion(b);
            int result_a = sem1.CompareTo(sem2);
            int result_b = sem2.CompareTo(sem1);


            if (result_a == 0)
            {
                Assert.Zero(result_b);
            }
            else
            {
                Assert.AreEqual(result_a * -1, result_b);
            }

            return(result_a);
        }
Example #3
0
        public void ValidVersionString(string input)
        {
            var semver = new SematicVersion(input);

            Assert.AreEqual(input, semver.ToString());
        }