public void PASS_Create() { BinaryProperty prop = new BinaryProperty("binaryme"); Assert.IsNotNull(prop); Assert.AreEqual("binaryme", prop.Name); }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { Dictionary<string, object> propDict = serializer.Deserialize<Dictionary<string, object>>(reader); BinaryProperty prop = new BinaryProperty(propDict.First().Key); FieldProperty.Deserialize(prop, JsonConvert.DeserializeObject<Dictionary<string, object>>(propDict.First().Value.ToString())); return prop; }
public void PASS_Serialize() { BinaryProperty prop = new BinaryProperty("binaryme"); string json = JsonConvert.SerializeObject(prop); Assert.IsNotNull(json); string expectedJson = "{\"binaryme\":{\"type\":\"binary\"}}"; Assert.AreEqual(expectedJson, json); }