コード例 #1
0
        public void PASS_Create()
        {
            BooleanProperty prop = new BooleanProperty("boolme");

            Assert.IsNotNull(prop);
            Assert.AreEqual("boolme", prop.Name);
        }
コード例 #2
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            Dictionary<string, object> propDict = serializer.Deserialize<Dictionary<string, object>>(reader);
            BooleanProperty prop = new BooleanProperty(propDict.First().Key);
            FieldProperty.Deserialize(prop, JsonConvert.DeserializeObject<Dictionary<string, object>>(propDict.First().Value.ToString()));

            return prop;
        }
コード例 #3
0
        public void PASS_Serialize()
        {
            BooleanProperty prop = new BooleanProperty("boolme");
            string json = JsonConvert.SerializeObject(prop);
            Assert.IsNotNull(json);

            string expectedJson = "{\"boolme\":{\"type\":\"boolean\"}}";
            Assert.AreEqual(expectedJson, json);
        }