示例#1
0
        public void Deserialize_TypeNull_ReturnsNull()
        {
            var subject = new Serializer();
            var result = subject.Deserialize(null, new Dictionary<string, object>());

            Assert.IsNull(result);
        }
示例#2
0
        public void Deserialize_SetsFieldFromDictionary(string expected)
        {
            var subject = new Serializer();

            var values = CreateDictionary("PublicField", expected);
            var result = (SerializationTarget)subject.Deserialize(typeof(SerializationTarget), values);

            Assert.AreEqual(expected, result.PublicField);
        }
示例#3
0
        public void Deserialize_String_GetsValueFromDictionary(string expected)
        {
            var subject = new Serializer();

            var values = new Dictionary<string, object>();
            values["Value"] = expected;

            var result = subject.Deserialize(typeof(string), values);

            Assert.AreEqual(expected, result);
        }