Beispiel #1
0
        public void SetUp()
        {
            var locator         = new InMemoryServiceLocator();
            var objectConverter = new ObjectConverter(locator, new ConverterLibrary(new[] { new StatelessComplexTypeConverter() }));

            locator.Add <IObjectConverter>(objectConverter);

            var converter = new ComplexTypeConverter(objectConverter);

            theInput      = "{\"Name\":\"Test\",\"Child\":\"x:123\"}";
            theSerializer = new NewtonSoftJsonSerializer(new JsonSerializerSettings(), new[] { converter });

            theObject = theSerializer.Deserialize <ParentType>(theInput);
        }
Beispiel #2
0
        public void SetUp()
        {
            theConverter  = new ComplexTypeConverter(new ObjectConverter());
            theSerializer = new NewtonSoftJsonSerializer(new JsonSerializerSettings(), new JsonConverter[] { theConverter });

            theTarget = new ParentType
            {
                Name  = "Test",
                Child = new ComplexType {
                    Key = "x", Value = "123"
                }
            };

            theResult = theSerializer.Serialize(theTarget);
        }