Example #1
0
 /// <summary>
 /// Modify existing field value
 /// </summary>
 /// <param name="fieldName"></param>
 /// <param name="fieldValue"></param>
 public void SetFieldValue(string fieldName, object fieldValue)
 {
     if (TestDatas.ContainsKey(fieldName))
     {
         TestDatas[fieldName] = fieldValue;
     }
     else
     {
         throw new KeyNotFoundException("Key Name is not found:" + fieldName);
     }
 }
Example #2
0
        /// <summary>
        /// Get field value by field name
        /// </summary>
        /// <param name="fieldName"></param>
        /// <returns></returns>
        public object GetFieldValue(string fieldName)
        {
            object value;

            if (TestDatas.ContainsKey(fieldName))
            {
                TestDatas.TryGetValue(fieldName, out value);
                return(value);
            }
            else
            {
                throw new KeyNotFoundException("Key Name is not found:" + fieldName);
            }
        }