Esempio n. 1
0
        public void base_smoke_dictionary()
        {
            var instance = new ClassWithDictionaryOfObject();

            instance.Value = new Dictionary <string, object>()
            {
                { "test", "blabla" }
            };
            var json = instance.ToJson();

            Assert.AreEqual("{ \"Value\" : { \"test\" : \"blabla\" } }", json);
        }
Esempio n. 2
0
        public void should_serialize_flat_in_dictionary()
        {
            var instance = new ClassWithDictionaryOfObject();

            instance.Value = new Dictionary <string, object>()
            {
                { "test", new SampleId(1) }
            };
            var json = instance.ToJson();

            Assert.AreEqual("{ \"Value\" : { \"test\" : \"Sample_1\" } }", json);
        }