コード例 #1
0
        private void PrimitiveAttributeSerializer_SerializeNumber_RoundtripSuccessfull(object value, Type type)
        {
            // arrange
            var serializer = new PrimitiveAttributeSerializer();
            // act
            var str          = serializer.Serialize(value);
            var roundtripped = serializer.Deserialize(str, type);

            // assert
            Assert.Equal(value, roundtripped);
        }
コード例 #2
0
        public void PrimitiveAttributeSerializer_SerializeEnum_RoundtripSuccessfull(Enum value)
        {
            // arrange
            var serializer = new PrimitiveAttributeSerializer();

            // act
            var strVal       = serializer.Serialize(value);
            var roundtripped = serializer.Deserialize(strVal, value.GetType());

            // assert
            Assert.Equal(value, roundtripped);
        }