public void UserFieldDefinition_AllowMultipleValues_ShouldUpdate_FieldType()
        {
            var def = new UserFieldDefinition();

            def.AllowMultipleValues = false;
            Assert.IsTrue(def.FieldType == BuiltInFieldTypes.User);

            def.AllowMultipleValues = true;
            Assert.IsTrue(def.FieldType == BuiltInFieldTypes.UserMulti);
        }
        protected override FieldDefinition GetFieldDefinitionTemplate()
        {
            var def = new UserFieldDefinition();

            if (Rnd.Bool())
                def.SelectionMode = BuiltInFieldUserSelectionMode.PeopleAndGroups;
            else
                def.SelectionMode = BuiltInFieldUserSelectionMode.PeopleOnly;

            def.Presence = Rnd.Bool();
            def.AllowDisplay = Rnd.Bool();

            return def;
        }
예제 #3
0
 public static ModelNode AddUserField(this ModelNode model, UserFieldDefinition definition, Action<ModelNode> action)
 {
     return model.AddDefinitionNode(definition, action);
 }
예제 #4
0
 public static ModelNode AddUserField(this ModelNode model, UserFieldDefinition definition)
 {
     return AddUserField(model, definition, null);
 }