Exemple #1
0
        public void CompareShouldbeCorrect()
        {
            var ordinal1 = new Ordinal(1);
            var ordinal2 = new Ordinal(2);
            var ordinal3 = new Ordinal(2);

            Assert.AreEqual(0, ordinal2.CompareTo(ordinal3));
            Assert.AreEqual(-1, ordinal1.CompareTo(ordinal2));
            Assert.AreEqual(1, ordinal2.CompareTo(ordinal1));
        }
Exemple #2
0
        public void CompareShouldbeCorrect()
        {
            var ordinal1 = new Ordinal(1);
            var ordinal2 = new Ordinal(2);
            var ordinal3 = new Ordinal(2);

            Assert.AreEqual(0, ordinal2.CompareTo(ordinal3));
            Assert.AreEqual(-1, ordinal1.CompareTo(ordinal2));
            Assert.AreEqual(1, ordinal2.CompareTo(ordinal1));
        }
        // compare
        public int CompareTo(ACsEnum <T, U, V> other)
        {
            if (other.GetType() != typeof(T))
            {
                return(-1);
            }

            return(Ordinal.CompareTo(other.Ordinal));
        }
Exemple #4
0
        public int CompareTo(object target)
        {
            var typedTarget = target as PolymorphicEnum <T, TEnum>;

            if (typedTarget == null)
            {
                throw new ArgumentException(@"Comparison can only occur between compatible enums.", nameof(target));
            }

            return(Ordinal.CompareTo(typedTarget.Ordinal));
        }
Exemple #5
0
        /// <summary>
        ///     Compares the current object with another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>
        ///     A value that indicates the relative order of the objects being compared. The return value has the following
        ///     meanings: Value Meaning Less than zero This object is less than the <paramref name="other" /> parameter.Zero This
        ///     object is equal to <paramref name="other" />. Greater than zero This object is greater than
        ///     <paramref name="other" />.
        /// </returns>
        public int CompareTo(Entry other)
        {
            if (other == null)
            {
                return(-1);
            }

            int result = Ordinal.CompareTo(other.Ordinal);

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

            return(String.Compare(Name, other.Name, StringComparison.Ordinal));
        }
Exemple #6
0
        public int CompareTo(SlotIdentifier other)
        {
            var ordinalComparison = Ordinal.CompareTo(other.Ordinal);

            if (ordinalComparison != 0)
            {
                return(ordinalComparison);
            }
            var clientComparison = ClientIdentifier.CompareTo(other.ClientIdentifier);

            if (clientComparison != 0)
            {
                return(clientComparison);
            }
            return(SlotID.CompareTo(other.SlotID));
        }
Exemple #7
0
 public int CompareTo(object obj)
 {
     return(Ordinal.CompareTo(obj));
 }
 public int CompareTo(SQLiteIndexColumn other) => Ordinal.CompareTo(other.Ordinal);
 public int CompareTo(SQLiteForeignKey other) => Ordinal.CompareTo(other.Ordinal);
Exemple #10
0
 public int CompareTo(VO_Layer obj)
 {
     return(Ordinal.CompareTo(obj.Ordinal));
 }