Пример #1
0
        private static void AddCustomVariableGroups()
        {
            for (int i = 1; i <= TotalNumberOfEachEntityToCreate; i++)
            {
                CustomVariableGroup group = new CustomVariableGroup();

                group.Name = "group" + i;

                // For each group, add some custom variables. The first group will have one variable,
                // the second will have two, and so on...
                for (int x = 1; x <= i; x++)
                {
                    group.CustomVariables.Add(new CustomVariable()
                    {
                        Key = "k" + x, Value = "v" + x
                    });
                }

                CustomVariableGroupLogic.Save(group);
            }

            // Add a group with the Deleted property set to true. It shouldn't affect the other tests because
            // getting all the groups should exclude the deleted group.
            Guid uniqueGroupName             = Guid.NewGuid();
            CustomVariableGroup deletedGroup = new CustomVariableGroup();

            deletedGroup.Name    = uniqueGroupName.ToString();
            deletedGroup.Deleted = true;
            CustomVariableGroupLogic.Save(deletedGroup);
        }
Пример #2
0
 public CustomVariableGroup SaveGroup(CustomVariableGroup customVariableGroup)
 {
     return(Invoke(() =>
     {
         CustomVariableGroup existingGroup = null;
         if (!string.IsNullOrWhiteSpace(customVariableGroup.Id))
         {
             existingGroup = CustomVariableGroupLogic.GetById(customVariableGroup.Id);
         }
         CustomVariableGroupLogic.Save(customVariableGroup);
         PossiblySendCustomVariableGroupChangedEmail(existingGroup, customVariableGroup);
         return customVariableGroup;
     }));
 }
Пример #3
0
        internal static CustomVariableGroup CreateCustomVariableGroup(string rootName)
        {
            CustomVariableGroup group = new CustomVariableGroup();

            group.Name = rootName + " group";

            group.CustomVariables.Add(new CustomVariable()
            {
                Key = rootName + " key", Value = rootName + " value"
            });

            CustomVariableGroupLogic.Save(group);

            return(group);
        }