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

            Assert.IsNotNull(prop);
            Assert.AreEqual("binaryme", 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);
            BinaryProperty prop = new BinaryProperty(propDict.First().Key);
            FieldProperty.Deserialize(prop, JsonConvert.DeserializeObject<Dictionary<string, object>>(propDict.First().Value.ToString()));

            return prop;
        }
コード例 #3
0
        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);
        }