コード例 #1
0
        public void ObjectWithList()
        {
            var data = new WithList
            {
                Value = 500,
                Items = new[]
                {
                    new SimplePoco {
                        IsImportant = true, Value = "foo"
                    },
                    new SimplePoco {
                        Value = "bar"
                    },
                    new SimplePoco {
                        IsImportant = true, Value = "baz"
                    },
                }
            };

            JsonConvert.Serialize(data).ShouldBeEquivalentTo(Newton.SerializeObject(data));
        }
コード例 #2
0
        public void ObjectWithList()
        {
            var expected = new WithList
            {
                Value = 500,
                Items = new[]
                {
                    new SimplePoco {
                        IsImportant = true, Value = "foo"
                    },
                    new SimplePoco {
                        Value = "bar"
                    },
                    new SimplePoco {
                        IsImportant = true, Value = "baz"
                    },
                }
            };

            JsonConvert.Deserialize <WithList>(Newton.SerializeObject(expected)).ShouldBeEquivalentTo(expected);
        }