public void Should_decode_json_values() { var source = JsonValue.Create("e30="); var result = ValueConverters.DecodeJson(TestUtils.DefaultSerializer)(source, jsonField); Assert.Equal(JsonValue.Object(), result); }
public void Should_return_same_value_if_decoding_null_value() { var source = JsonValue.Null; var result = ValueConverters.DecodeJson(TestUtils.DefaultSerializer)(source, jsonField); Assert.Same(source, result); }
public static NamedContentData FromMongoModel(this IdContentData result, Schema schema, IJsonSerializer serializer) { return(result.ConvertId2Name(schema, FieldConverters.ForValues( ValueConverters.DecodeJson(serializer)), FieldConverters.ForNestedId2Name( ValueConverters.DecodeJson(serializer)))); }
public void Should_return_same_value_if_decoding_null_value() { var source = JValue.CreateNull(); var result = ValueConverters.DecodeJson()(source, jsonField); Assert.Same(source, result); }
public void Should_decode_json_values() { var source = "e30="; var result = ValueConverters.DecodeJson()(source, jsonField); Assert.Equal(new JObject(), result); }
public static NamedContentData FromMongoModel(this IdContentData result, Schema schema, List <Guid> deletedIds) { return(result.ConvertId2Name(schema, FieldConverters.ForValues( ValueConverters.DecodeJson(), ValueReferencesConverter.CleanReferences(deletedIds)), FieldConverters.ForNestedId2Name( ValueConverters.DecodeJson(), ValueReferencesConverter.CleanReferences(deletedIds)))); }
public DataConverter(IJsonSerializer serializer) { var decoder = ValueConverters.DecodeJson(serializer); decodeJsonConverters = new[] { FieldConverters.ForValues(decoder, ValueConverters.ForNested(decoder)) }; var encoder = ValueConverters.EncodeJson(serializer); encodeJsonConverters = new[] { FieldConverters.ForValues(encoder, ValueConverters.ForNested(encoder)) }; }
public DataConverter(IJsonSerializer serializer) { decodeJsonConverters = new[] { FieldConverters.ForValues( ValueConverters.DecodeJson(serializer)), FieldConverters.ForNestedId2Name( ValueConverters.DecodeJson(serializer)) }; encodeJsonConverters = new[] { FieldConverters.ForValues( ValueConverters.EncodeJson(serializer)), FieldConverters.ForNestedName2Id( ValueConverters.EncodeJson(serializer)) }; }