예제 #1
0
        public void GeneratedSerializersRoundTripThroughSerializer()
        {
            var original = new SomeClassWithSerializers {
                IntField = 2, IntProperty = 30
            };
            var result = (SomeClassWithSerializers)RoundTripThroughUntypedSerializer(original, out _);

            Assert.Equal(original.IntField, result.IntField);
            Assert.Equal(original.IntProperty, result.IntProperty);
        }
예제 #2
0
        public void UnmarkedFieldsAreNotSerialized()
        {
            var original = new SomeClassWithSerializers {
                IntField = 2, IntProperty = 30, UnmarkedField = 12, UnmarkedProperty = 47
            };
            var result = RoundTripThroughCodec(original);

            Assert.NotEqual(original.UnmarkedField, result.UnmarkedField);
            Assert.NotEqual(original.UnmarkedProperty, result.UnmarkedProperty);
        }
예제 #3
0
        public void GeneratedSerializersRoundTripThroughCodec()
        {
            var original = new SomeClassWithSerializers {
                IntField = 2, IntProperty = 30
            };
            var result = RoundTripThroughCodec(original);

            Assert.Equal(original.IntField, result.IntField);
            Assert.Equal(original.IntProperty, result.IntProperty);
        }