// override object.GetHashCode
 public override int GetHashCode()
 {
     return(Tag.GetHashCode()
            ^ lhs.GetHashCode()
            ^ rhs.GetHashCode()
            ^ IsNegative.GetHashCode());
 }
 // override object.GetHashCode
 public override int GetHashCode()
 {
     return(Tag.GetHashCode()
            ^ Name.GetHashCode()
            ^ Value.GetHashCode()
            ^ IsNegative.GetHashCode());
 }
Example #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = IsNegative.GetHashCode();
         hashCode = (hashCode * 397) ^ ClustersLength;
         hashCode = (hashCode * 397) ^ Length;
         hashCode = (hashCode * 397) ^ (Clusters != null ? Clusters.GetHashCode() : 0);
         return(hashCode);
     }
 }
        public void IsItNegative_ZeroPassed_ThrowsException()
        {
            Exception exception = null;

            try
            {
                IsNegative.IsItNegative(0);
            }
            catch (Exception ex)
            {
                exception = ex;
            }
            Assert.IsNotNull(exception);
        }
Example #5
0
        public void CanTellForMinValues()
        {
            sbyte   numberByte    = sbyte.MinValue;
            short   numberShort   = short.MinValue;
            int     numerInt      = int.MinValue;
            long    numberLong    = long.MinValue;
            float   numberFloat   = float.MinValue;
            double  numberDouble  = double.MinValue;
            decimal numberDecimal = decimal.MinValue;

            Assert.True(IsNegative.Check(numberByte));
            Assert.True(IsNegative.Check(numberShort));
            Assert.True(IsNegative.Check(numerInt));
            Assert.True(IsNegative.Check(numberLong));
            Assert.True(IsNegative.Check(numberFloat));
            Assert.True(IsNegative.Check(numberDouble));
            Assert.True(IsNegative.Check(numberDecimal));
        }
Example #6
0
        public void CanTellTrueForRightInput()
        {
            sbyte   numberByte    = -1;
            short   numberShort   = -1;
            int     numerInt      = -1;
            long    numberLong    = -1L;
            float   numberFloat   = -1.0F;
            double  numberDouble  = -1.0D;
            decimal numberDecimal = -1;

            Assert.True(IsNegative.Check(numberByte));
            Assert.True(IsNegative.Check(numberShort));
            Assert.True(IsNegative.Check(numerInt));
            Assert.True(IsNegative.Check(numberLong));
            Assert.True(IsNegative.Check(numberFloat));
            Assert.True(IsNegative.Check(numberDouble));
            Assert.True(IsNegative.Check(numberDecimal));
        }
Example #7
0
        public void CanTellFor0()
        {
            sbyte   numberByte    = 0;
            short   numberShort   = 0;
            int     numerInt      = 0;
            long    numberLong    = 0;
            float   numberFloat   = 0;
            double  numberDouble  = 0;
            decimal numberDecimal = 0;

            Assert.False(IsNegative.Check(numberByte));
            Assert.False(IsNegative.Check(numberShort));
            Assert.False(IsNegative.Check(numerInt));
            Assert.False(IsNegative.Check(numberLong));
            Assert.False(IsNegative.Check(numberFloat));
            Assert.False(IsNegative.Check(numberDouble));
            Assert.False(IsNegative.Check(numberDecimal));
        }
 // override object.GetHashCode
 public override int GetHashCode()
 {
     return(Tag.GetHashCode()
            ^ Child.GetHashCode()
            ^ IsNegative.GetHashCode());
 }
Example #9
0
 public static bool Check(double number)
 {
     return(!IsNegative.Check(number) && !IsZero.Check(number));
 }
Example #10
0
 public override int GetHashCode()
 {
     return(IsNegative.GetHashCode() ^ Digit.GetHashCode());
 }
 public void IsItNegative_NegativeNumberPassed_ReturnsTrue()
 {
     Assert.IsTrue(IsNegative.IsItNegative(-5));
 }
 public void IsItNegative_PositveNumberPassed_ReturnsFalse()
 {
     Assert.IsFalse(IsNegative.IsItNegative(5));
 }