Example #1
0
 public static object GetValidInput(KeyValuePair <string, ResourceFields.InputType> InputType, int index, HrbcRecordCreator records, HrbcFieldReader fieldReader)
 {
     UpdateSystemResourceId(records, index);
     if (InputType.Value == ResourceFields.InputType.Option)
     {
         string optionMaster = OptionFieldHelper.GetOptionMaster(fieldReader, InputType.Key);
         Assume.That(optionMaster, Is.Not.Null.And.Not.Empty, "Cannot get the master option!");
         List <string> optionList = OptionFieldHelper.GetOptionList(optionMaster);
         Assume.That(optionList, Is.Not.Null.And.Not.Empty, "Cannot get the option list!");
         return(new Option()
         {
             ActualXMLTag = optionList.First()
         });
     }
     if (InputType.Value == ResourceFields.InputType.UserList)
     {
         Activity activity = CreateActivityInstance();
         activity.EventParticipants = new ArrayList()
         {
             new User()
             {
                 Id = "1"
             }
         };
         return((activity as XmlResource).DictionaryValues[InputType.Key]);
     }
     return(valueDictionary[InputType.Value].ToString());
 }
Example #2
0
        /// <summary>
        /// Get option list
        /// </summary>
        /// <param name="fieldReader">HrbcFieldReader</param>
        /// <param name="fieldAlias">Field alias</param>
        /// <returns></returns>
        public static List <string> GetOptionList(HrbcFieldReader fieldReader, string fieldAlias)
        {
            string optionMaster = OptionFieldHelper.GetOptionMaster(fieldReader, fieldAlias);

            Assume.That(optionMaster, Is.Not.Null.And.Not.Empty, "Cannot get the master option!");
            List <string> optionList = OptionFieldHelper.GetOptionList(optionMaster);

            Assume.That(optionList, Is.Not.Null.And.Not.Empty, "Cannot get the option list!");
            return(optionList);
        }