Esempio n. 1
0
        public override int CompareTo(IValue other)
        {
            if (other?.DataType == DataType.String)
            {
                return(String.Compare(_value, other.AsString(), StringComparison.Ordinal));
            }

            throw RuntimeException.ComparisonNotSupportedException();
        }
Esempio n. 2
0
        public int CompareTo(IValue other)
        {
            GuidWrapper otherUuid = other.GetRawValue() as GuidWrapper;

            if (otherUuid == null)
            {
                throw RuntimeException.ComparisonNotSupportedException();
            }

            return(_value.CompareTo(otherUuid._value));
        }
 public int CompareTo(IValue other)
 {
     if (other.SystemType.Equals(this.SystemType))
     {
         if (this.Equals(other))
         {
             return(0);
         }
         else
         {
             throw RuntimeException.ComparisonNotSupportedException();
         }
     }
     else
     {
         return(this.SystemType.ToString().CompareTo(other.SystemType.ToString()));
     }
 }
Esempio n. 4
0
        public void Invalid_Comparison_Undefined()
        {
            var v1 = ValueFactory.Create();
            var v2 = ValueFactory.Create(true);

            try
            {
                v1.CompareTo(v2);
            }
            catch (RuntimeException e)
            {
                var validExc = RuntimeException.ComparisonNotSupportedException();
                Assert.True(e.Message == validExc.Message);
                return;
            }

            throw new Exception("No exception thrown");
        }
Esempio n. 5
0
 public virtual int CompareTo(IValue other)
 {
     throw RuntimeException.ComparisonNotSupportedException();
 }