Esempio n. 1
0
        public void Should_return_same_values_if_decoding_non_json_field()
        {
            var source =
                new ContentFieldData()
                .AddValue("en", null);

            var result = FieldConverters.DecodeJson()(source, stringLanguageField);

            Assert.Same(source, result);
        }
Esempio n. 2
0
        public void Should_decode_json_values()
        {
            var source =
                new ContentFieldData()
                .AddValue("en", null)
                .AddValue("de", "e30=");

            var result = FieldConverters.DecodeJson()(source, Fields.Json(1, "1", Partitioning.Invariant));

            Assert.Null(result["en"]);
            Assert.True(result["de"] is JObject);
        }
Esempio n. 3
0
 public static NamedContentData FromMongoModel(this IdContentData result, Schema schema, List <Guid> deletedIds)
 {
     return(result.ToNameModel(schema, FieldConverters.DecodeJson(), FieldReferencesConverter.CleanReferences(deletedIds)));
 }