protected override FieldDefinition GetFieldDefinitionTemplate()
        {
            var def = new ChoiceFieldDefinition();

            var choiceCount = Rnd.Int(10) + 1;

            for (var index = 0; index < choiceCount; index++)
            {
                def.Choices.Add(Rnd.String(8));
                def.Mappings.Add(Rnd.String(8));
            }

            def.ValidationMessage = string.Format("validatin_msg_{0}", Rnd.String());
            def.ValidationFormula = string.Format("=[ID] * {0}", Rnd.Int(100));

            return def;
        }
 public static ModelNode AddChoiceField(this ModelNode model, ChoiceFieldDefinition definition, Action<ModelNode> action)
 {
     return model.AddDefinitionNode(definition, action);
 }
        public void ChoiceFieldDefinition_ShoudHave_NotNollChoicesProperty()
        {
            var def = new ChoiceFieldDefinition();

            Assert.IsNotNull(def.Choices);
        }
 public static ModelNode AddChoiceField(this ModelNode model, ChoiceFieldDefinition definition)
 {
     return AddChoiceField(model, definition, null);
 }