public void Should_enrich_with_default_values()
        {
            var data =
                new ContentData()
                .AddField("my-string",
                          new ContentFieldData()
                          .AddLocalized("de", "de-string"))
                .AddField("my-number",
                          new ContentFieldData()
                          .AddInvariant(456));

            data.GenerateDefaultValues(schema, languagesConfig.ToResolver());

            Assert.Equal(456, ((JsonNumber)data["my-number"] !["iv"]).Value);
Beispiel #2
0
 public static void GenerateDefaultValues(this OperationContext context, ContentData data)
 {
     data.GenerateDefaultValues(context.Schema.SchemaDef, context.Partition());
 }
Beispiel #3
0
 public static void GenerateDefaultValues(this ContentOperation operation, ContentData data)
 {
     data.GenerateDefaultValues(operation.Schema.SchemaDef, operation.Partition());
 }
        public Task GenerateDefaultValuesAsync(ContentData data)
        {
            data.GenerateDefaultValues(schema.SchemaDef, Partition());

            return(Task.CompletedTask);
        }