Exemplo n.º 1
0
        public void SerializeAndDeserialize_ObjectUsingInternalObjectSerializer()
        {
            var obj  = new TestClassWithInternalObjectSerializer();
            var copy = SerializeAndDeserializeObject(obj) as TestClassWithInternalObjectSerializer;

            Assert.Equal(obj, copy);
        }
Exemplo n.º 2
0
 protected bool Equals(TestClassWithInternalObjectSerializer other)
 {
     return(BooleanFalse == other.BooleanFalse &&
            BooleanTrue == other.BooleanTrue &&
            Char == other.Char &&
            SByte == other.SByte &&
            Byte == other.Byte &&
            Int16 == other.Int16 &&
            UInt16 == other.UInt16 &&
            Int32 == other.Int32 &&
            UInt32 == other.UInt32 &&
            Int64 == other.Int64 &&
            UInt64 == other.UInt64 &&
            Single.Equals(other.Single) &&
            Double.Equals(other.Double) &&
            Decimal == other.Decimal &&
            String == other.String &&
            DateTime == other.DateTime &&
            DateTimeOffset == other.DateTimeOffset &&
            Guid == other.Guid &&
            NonGenericType == other.NonGenericType &&
            GenericTypeDefinition == other.GenericTypeDefinition &&
            ClosedConstructedGenericType == other.ClosedConstructedGenericType &&
            NullReference == other.NullReference &&
            Enum_S8 == other.Enum_S8 &&
            Enum_U8 == other.Enum_U8 &&
            Enum_S16 == other.Enum_S16 &&
            Enum_U16 == other.Enum_U16 &&
            Enum_S32 == other.Enum_S32 &&
            Enum_U32 == other.Enum_U32 &&
            Enum_S64 == other.Enum_S64 &&
            Enum_U64 == other.Enum_U64 &&
            SerializableObject.SequenceEqual(other.SerializableObject) &&
            ByteArrayEqualityComparer.AreEqual(Buffer1, other.Buffer1));
 }
Exemplo n.º 3
0
 protected bool Equals(TestClassWithInternalObjectSerializer other)
 {
     return(SByte == other.SByte &&
            Byte == other.Byte &&
            Int16 == other.Int16 &&
            UInt16 == other.UInt16 &&
            Int32 == other.Int32 &&
            UInt32 == other.UInt32 &&
            Int64 == other.Int64 &&
            UInt64 == other.UInt64 &&
            Single.Equals(other.Single) &&
            Double.Equals(other.Double) && Decimal == other.Decimal && Char == other.Char);
 }