Пример #1
0
        public void TestEquals([Random(0L, 10000L, 3)] long rawValue)
        {
            var float1 = new Float(rawValue);
            var fixnum = new Fixnum(rawValue);

            Assert.IsTrue(float1.Equals(new Float(rawValue)));
            Assert.IsTrue(float1.Equals(fixnum));
            Assert.IsFalse(float1.Equals(new Float(rawValue + 1)));
            Assert.IsFalse(float1.Equals(null));
            Assert.IsFalse(float1.Equals(new String(rawValue.ToString())));
        }
Пример #2
0
 public bool Equals(EquatableTestVertex other)
 {
     if (other is null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     if (GetType() != other.GetType())
     {
         return(false);
     }
     return(string.Equals(ID, other.ID) &&
            string.Equals(StringDefault, other.StringDefault) &&
            string.Equals(String, other.String) &&
            Int == other.Int &&
            Long == other.Long &&
            Bool == other.Bool &&
            Float.Equals(other.Float) &&
            Double.Equals(other.Double) &&
            Equals(IntArray, other.IntArray) &&
            Equals(IntIList, other.IntIList));
 }
Пример #3
0
 protected bool Equals(AllTypes <T> other)
 {
     return(Id == other.Id && NullableId == other.NullableId &&
            Byte == other.Byte &&
            Short == other.Short &&
            Int == other.Int &&
            Long == other.Long &&
            UShort == other.UShort &&
            UInt == other.UInt &&
            ULong == other.ULong &&
            Float.Equals(other.Float) &&
            Double.Equals(other.Double) &&
            Decimal == other.Decimal &&
            string.Equals(String, other.String) &&
            DateTime.Equals(other.DateTime) &&
            TimeSpan.Equals(other.TimeSpan) &&
            DateTimeOffset.Equals(other.DateTimeOffset) &&
            Guid.Equals(other.Guid) &&
            Char == other.Char &&
            NullableDateTime.Equals(other.NullableDateTime) &&
            NullableTimeSpan.Equals(other.NullableTimeSpan) &&
            StringList.EquivalentTo(other.StringList) &&
            StringArray.EquivalentTo(other.StringArray) &&
            StringMap.EquivalentTo(other.StringMap) &&
            IntStringMap.EquivalentTo(other.IntStringMap) &&
            Equals(SubType, other.SubType) &&
            Equals(GenericType, other.GenericType));
 }
Пример #4
0
 private bool Equals(ArrayReaderTest other)
 {
     return(Byte == other.Byte && Short == other.Short &&
            ArrayReaderTestId == other.ArrayReaderTestId && Long == other.Long &&
            Float.Equals(other.Float) && Double.Equals(other.Double) &&
            Decimal == other.Decimal && Bool == other.Bool && String == other.String &&
            Guid.Equals(other.Guid) && DateTime.Equals(other.DateTime));
 }
Пример #5
0
 private bool Equals(KeyAll other)
 {
     return(Byte == other.Byte && SByte == other.SByte && Short == other.Short &&
            UShort == other.UShort && Int == other.Int && UInt == other.UInt && Long == other.Long &&
            ULong == other.ULong && Float.Equals(other.Float) && Double.Equals(other.Double) &&
            Decimal == other.Decimal && Guid.Equals(other.Guid) && string.Equals(String, other.String) &&
            Key.Equals(other.Key));
 }
 protected bool Equals(BasicTypes other)
 {
     return(Bool.Equals(other.Bool) && Byte == other.Byte && Character == other.Character &&
            Decimal == other.Decimal && Double.Equals(other.Double) && Float.Equals(other.Float) &&
            Int == other.Int && Long == other.Long && SByte == other.SByte && Short == other.Short &&
            string.Equals(String, other.String) && UInt == other.UInt && UShort == other.UShort &&
            ULong == other.ULong);
 }
Пример #7
0
 protected bool Equals(KitchenSinkPortable other)
 {
     return(Bool == other.Bool && BoolArray.SequenceEqual(other.BoolArray) &&
            ByteArray.SequenceEqual(other.ByteArray) && Byte == other.Byte &&
            CharArray.SequenceEqual(other.CharArray) && Char == other.Char &&
            ShortArray.SequenceEqual(other.ShortArray) &&
            Short == other.Short && IntArray.SequenceEqual(other.IntArray) && Int == other.Int &&
            LongArray.SequenceEqual(other.LongArray) && Long == other.Long &&
            FloatArray.SequenceEqual(other.FloatArray) &&
            Float.Equals(other.Float) && DoubleArray.SequenceEqual(other.DoubleArray) &&
            Double.Equals(other.Double) &&
            string.Equals(String, other.String) && StringArray.SequenceEqual(other.StringArray)
            );
 }
Пример #8
0
 protected bool Equals(KitchenSinkDataSerializable other)
 {
     return(BoolArray.SequenceEqual(other.BoolArray) && Bool == other.Bool &&
            ByteArray.SequenceEqual(other.ByteArray) && Byte == other.Byte &&
            CharArray.SequenceEqual(other.CharArray) && Char == other.Char &&
            ShortArray.SequenceEqual(other.ShortArray) &&
            Short == other.Short && IntArray.SequenceEqual(other.IntArray) && Int == other.Int &&
            LongArray.SequenceEqual(other.LongArray) && Long == other.Long &&
            FloatArray.SequenceEqual(other.FloatArray) &&
            Float.Equals(other.Float) && DoubleArray.SequenceEqual(other.DoubleArray) &&
            Double.Equals(other.Double) &&
            string.Equals(Chars, other.Chars) && string.Equals(String, other.String) &&
            StringArray.SequenceEqual(other.StringArray) &&
            Equals(Serializable, other.Serializable) && Equals(Portable, other.Portable) &&
            Equals(Data, other.Data) && DateTime.Equals(other.DateTime));
 }
        public bool Equals(Value other)
        {
            if (Type != other.Type)
            {
                if (Type == ValueType.Float && other.Type == ValueType.Int || Type == ValueType.Int && other.Type == ValueType.Float)
                {
                    return(Float.Equals(other.Float));
                }
            }
            switch (Type)
            {
            case ValueType.Unknown:
                return(false);

            case ValueType.Bool:
                return(Bool == other.Bool);

            case ValueType.Int:
                return(Int == other.Int);

            case ValueType.Float:
                return(Float == other.Float);

            case ValueType.Float2:
                return(Float2.Equals(other.Float2));

            case ValueType.Float3:
                return(Float3.Equals(other.Float3));

            case ValueType.Float4:
                return(Float4.Equals(other.Float4));

            case ValueType.Quaternion:
                return(Quaternion.Equals(other.Quaternion));

            case ValueType.Entity:
                return(Entity == other.Entity);

            case ValueType.StringReference:
                return(StringReference.Equals(other.StringReference));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Пример #10
0
        protected bool Equals(object other)
        {
            if (this == other)
            {
                return(true);
            }
            if (other == null)
            {
                return(false);
            }
            if (GetType() != other.GetType())
            {
                return(false);
            }
            var class2 = (Class2)other;

            return(Bool == class2.Bool && Byte == class2.Byte && Char == class2.Char && Double.Equals(class2.Double) &&
                   Float.Equals(class2.Float) && Int == class2.Int && Long == class2.Long && Sbyte == class2.Sbyte &&
                   Short == class2.Short && UInt == class2.UInt && Ulong == class2.Ulong && Ushort == class2.Ushort);
        }
 protected bool Equals(AllFields other)
 {
     return(Id == other.Id &&
            NullableId == other.NullableId &&
            Byte == other.Byte &&
            Short == other.Short &&
            Int == other.Int &&
            Long == other.Long &&
            UShort == other.UShort &&
            UInt == other.UInt &&
            ULong == other.ULong &&
            Float.Equals(other.Float) &&
            Double.Equals(other.Double) &&
            Decimal == other.Decimal &&
            string.Equals(String, other.String) &&
            DateTime.Equals(other.DateTime) &&
            TimeSpan.Equals(other.TimeSpan) &&
            Guid.Equals(other.Guid) &&
            NullableDateTime.Equals(other.NullableDateTime) &&
            NullableTimeSpan.Equals(other.NullableTimeSpan) &&
            NullableGuid.Equals(other.NullableGuid));
 }
Пример #12
0
 protected bool Equals(AllTypes other)
 {
     return(Id == other.Id &&
            NullableId == other.NullableId &&
            Byte == other.Byte &&
            Short == other.Short &&
            Int == other.Int &&
            Long == other.Long &&
            UShort == other.UShort &&
            UInt == other.UInt &&
            ULong == other.ULong &&
            Float.Equals(other.Float) &&
            Double.Equals(other.Double) &&
            Decimal == other.Decimal &&
            string.Equals(String, other.String) &&
            DateTime.Equals(other.DateTime) &&
            TimeSpan.Equals(other.TimeSpan) &&
            DateTimeOffset.Equals(other.DateTimeOffset) &&
            Guid.Equals(other.Guid) &&
            Bool == other.Bool &&
            Char == other.Char &&
            NullableDateTime.Equals(other.NullableDateTime) &&
            NullableTimeSpan.Equals(other.NullableTimeSpan) &&
            ByteArray.SequenceEqual(other.ByteArray) &&
            CharArray.SequenceEqual(other.CharArray) &&
            IntArray.SequenceEqual(other.IntArray) &&
            LongArray.SequenceEqual(other.LongArray) &&
            StringArray.SequenceEqual(other.StringArray) &&
            StringList.SequenceEqual(other.StringList) &&
            StringMap.SequenceEqual(other.StringMap) &&
            IntStringMap.SequenceEqual(other.IntStringMap) &&
            SubType.Equals(other.SubType) &&
            SubTypes.SequenceEqual(other.SubTypes) &&
            CustomText == other.CustomText &&
            MaxText == other.MaxText &&
            CustomDecimal.Equals(other.CustomDecimal));
 }
Пример #13
0
 protected bool Equals(NuspecSettings other)
 {
     return(Float.Equals(other.Float) && Fixed.Equals(other.Fixed));
 }
 public bool Equals(UserDefinedStruct other)
 {
     return(Bool == other.Bool && Int32 == other.Int32 && Float.Equals(other.Float));
 }
Пример #15
0
 protected bool Equals(TestObject other)
 {
     return(Integer == other.Integer && Float.Equals(other.Float) && Double.Equals(other.Double) && string.Equals(Data, other.Data) && Equals(Child, other.Child) && AreEqual(ObjectArray, other.ObjectArray) && AreEqual(IntArray, other.IntArray));
 }
Пример #16
0
 protected bool Equals(NumberTypes other)
 {
     return(Int == other.Int && Float.Equals(other.Float) && Double.Equals(other.Double) && Decimal == other.Decimal);
 }
 protected bool Equals(ModelWithNullableFloatTypes other)
 {
     return(Float.Equals(other.Float) && Double.Equals(other.Double) && Decimal == other.Decimal);
 }