Exemple #1
0
        private void TestDeserialization(FakeObjectProperty property, object value, object expected)
        {
            var parser = new DynamicPropertyTypeParser(property, ObjectPropertyParser.GetPropertyInfoViaTypeLookup(property), value);

            var result = parser.DeserializeValue();

            Assert.AreEqual(expected, result);
        }
Exemple #2
0
        private void TestArrayDeserialization(FakeObjectProperty property, object value, object expected)
        {
            var parser = new DynamicPropertyTypeParser(property, ObjectPropertyParser.GetPropertyInfoViaTypeLookup(property), value);

            var result = parser.DeserializeValue();

            if (result == null)
            {
                Assert.AreEqual(expected, result);
            }
            else
            {
                Assert.IsInstanceOfType(expected, typeof(string[]));
                Assert.IsInstanceOfType(result, typeof(string[]));

                AssertEx.AreEqualLists(((string[])expected).ToList(), (((string[])result).ToList()), "Expected and result were not equal");
            }
        }