Exemple #1
0
        public void CompareToTest()
        {
            var date      = new ReleaseDate(2000);
            var dateMonth = new ReleaseDate(2001, 2);
            var dateDay   = new ReleaseDate(2002, 5, 12);

            Assert.AreEqual(-1, date.CompareTo(dateMonth));
            Assert.AreEqual(0, date.CompareTo(new ReleaseDate(2000)));
            Assert.AreEqual(1, dateDay.CompareTo(date));
        }
        /** <inheritDoc /> */
        public int CompareTo(IgniteProductVersion other)
        {
            IgniteArgumentCheck.NotNull(other, "other");

            // NOTE: Unknown version is less than any other version.
            int res = Major.CompareTo(other.Major);

            if (res != 0)
            {
                return(res);
            }

            res = Minor.CompareTo(other.Minor);

            if (res != 0)
            {
                return(res);
            }

            res = Maintenance.CompareTo(other.Maintenance);

            if (res != 0)
            {
                return(res);
            }

            return(ReleaseDate.CompareTo(other.ReleaseDate));
        }