public void NullHandling()
        {
            var obj1 = new ClassWithInner();        // Not setting the inner

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

            var obj2 = (ClassWithInner)serializer.Deserialize(msg);
            Assert.NotNull(obj2);
            Assert.Null(obj2.Inner);
        }
Beispiel #2
0
        public void NullHandling()
        {
            var obj1 = new ClassWithInner();        // Not setting the inner

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

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

            Assert.NotNull(obj2);
            Assert.Null(obj2.Inner);
        }
        public void HandlesInnerObjects()
        {
            var obj1 = new ClassWithInner { Inner = new ClassWithInner() };

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

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

            Assert.NotNull(obj2.Inner);
            Assert.NotSame(obj2, obj2.Inner);
        }
Beispiel #4
0
        public void HandlesInnerObjects()
        {
            var obj1 = new ClassWithInner {
                Inner = new ClassWithInner()
            };

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

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

            Assert.NotNull(obj2.Inner);
            Assert.NotSame(obj2, obj2.Inner);
        }