Beispiel #1
0
        public void ParameterExpressionShouldDeserialize(ParameterExpression parameter)
        {
            var serialized   = TestSerializer.GetSerializedFragment <Parameter, ParameterExpression>(parameter);
            var deserialized = serializer.Deserialize(serialized, new SerializationState());

            Assert.Equal(parameter.Type, deserialized.Type);
            if (!string.IsNullOrWhiteSpace(parameter.Name))
            {
                Assert.Equal(parameter.Name, deserialized.Name);
            }
        }
        public void ParameterExpressionShouldDeserialize(ParameterExpression parameter)
        {
            var serialized   = serializer.Serialize(parameter, TestSerializer.GetDefaultState());
            var deserialized = serializer.Deserialize(serialized, TestSerializer.State);

            Assert.Equal(parameter.Type, deserialized.Type);
            if (!string.IsNullOrWhiteSpace(parameter.Name))
            {
                Assert.Equal(parameter.Name, deserialized.Name);
            }
        }