Exemple #1
0
        public void ObjectIdentityNotEquals_FRN65()
        {
            // Using GetHashCode and Equals is not good enough for testing object identity
            // FRN65Class always returns true for Equals and a constant for GetHashCode
            var obj1 = new FRN65Class {
                Val = "A", Other = new FRN65Class {
                    Val = "B"
                }
            };

            var serializer = new FudgeSerializer(context);
            var msg        = serializer.SerializeToMsg(obj1);

            var obj2 = (FRN65Class)serializer.Deserialize(msg);

            Assert.NotSame(obj2, obj2.Other);
        }
        public void ObjectIdentityNotEquals_FRN65()
        {
            // Using GetHashCode and Equals is not good enough for testing object identity
            // FRN65Class always returns true for Equals and a constant for GetHashCode
            var obj1 = new FRN65Class { Val = "A", Other = new FRN65Class { Val = "B" } };

            var serializer = new FudgeSerializer(context);
            var msg = serializer.SerializeToMsg(obj1);

            var obj2 = (FRN65Class)serializer.Deserialize(msg);

            Assert.NotSame(obj2, obj2.Other);
        }