public void DetailCollections()
        {
            var item = new CI();

            item.GetDetailCollection("Hello", true).Add("World");

            var result = item.ToJson();

            var deserialized = new JavaScriptSerializer().Deserialize <Dictionary <string, object> >(result);

            deserialized["Hello"].ShouldBe(new[] { "World" });
        }
        public void DetailCollections_Link()
        {
            var first = new CI {
                ID = 1, Title = "first"
            };
            var second = new CI {
                ID = 2, Title = "second"
            };

            first.GetDetailCollection("Hello", true).Add(second);

            var result = first.ToJson();

            var deserialized = new JavaScriptSerializer().Deserialize <Dictionary <string, object> >(result);

            deserialized["Hello"].ShouldBe(new[] { 2 });
        }
Пример #3
0
        public void DetailCollections_Link()
        {

            var first = new CI { ID = 1, Title = "first" };
            var second = new CI { ID = 2, Title = "second" };

            first.GetDetailCollection("Hello", true).Add(second);

            var result = first.ToJson();

            var deserialized = new JavaScriptSerializer().Deserialize<Dictionary<string, object>>(result);
            deserialized["Hello"].ShouldBe(new[] { 2 });
        }
Пример #4
0
        public void DetailCollections()
        {
            var item = new CI();
            item.GetDetailCollection("Hello", true).Add("World");

            var result = item.ToJson();

            var deserialized = new JavaScriptSerializer().Deserialize<Dictionary<string, object>>(result);
            deserialized["Hello"].ShouldBe(new[] { "World" });
        }