Exemple #1
0
        public void CanSerializeToJSONFromSomeType1_ThenCanDeserializeToSomeType()
        {
            var someType1 = new SomeType1 { StringProp = "StringProp", StringProp1 = "StringProp1" };

            var json = TypeSerializer.SerializeToString(someType1);

            var someType = TypeSerializer.DeserializeFromString<SomeType>(json);

            Assert.That(someType.StringProp, Is.EqualTo(someType1.StringProp));
        }
Exemple #2
0
        public void CanSerializeToJSONFromSomeType1_ThenCanDeserializeToSomeType()
        {
            var someType1 = new SomeType1 {
                StringProp = "StringProp", StringProp1 = "StringProp1"
            };

            var json = TypeSerializer.SerializeToString(someType1);

            var someType = TypeSerializer.DeserializeFromString <SomeType>(json);

            Assert.That(someType.StringProp, Is.EqualTo(someType1.StringProp));
        }