示例#1
0
        public void JsonToJson()
        {
            var json   = new JObject();
            var result = json.Adapt <JObject>(_config);

            result.ShouldBe(json);
        }
示例#2
0
        public void ToObject()
        {
            var json = new JObject {
                ["foo"] = "bar"
            };
            var result = json.Adapt <Mock>(_config);

            result.foo.ShouldBe("bar");
        }
示例#3
0
        public void ToString()
        {
            var json = new JObject {
                ["foo"] = "bar"
            };
            var result = json.Adapt <string>(_config);

            result.ShouldContainWithoutWhitespace(@"{""foo"":""bar""}");
        }