示例#1
0
        public void CanReadArrayOfObjects()
        {
            var arrayKey = "ArrayOfObjects";

            var expectedValue = JArray.Parse(@"[{
            'Name': 'QuinnAndValor',
            'Kingdom': {
                'State': 'Demacia',
                'Street': '1 Eagle St',
                'ZipCode': '02903'
            }
        },{
            'Name': 'Caitlyn',
            'Kingdom': {
                'State': 'Piltover',
                'Street': '1 Police Way',
                'ZipCode': '02907'
            }
        }]
        ");

            var testValue = jsonReader.ReadArrayOfJsonObjects(arrayKey);

            Assert.IsTrue(JToken.DeepEquals(testValue, expectedValue));
        }