public void PASS_Create() { BooleanProperty prop = new BooleanProperty("boolme"); Assert.IsNotNull(prop); Assert.AreEqual("boolme", prop.Name); }
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; }
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); }