コード例 #1
0
        public static string GetValueFromBuddyTestDetails(string key)
        {
            List <KeyValuePair <string, string> > matches = BuddyTestRequiredDetails.FindAll(x => x.Key == key);

            if (matches.Any())
            {
                return(matches.First().Value);
            }
            return(string.Empty);
        }
コード例 #2
0
        public static void SetCurrentBuddyRequiredDetails(string details)
        {
            if (string.IsNullOrEmpty(details))
            {
                return;
            }

            string[] detailsEach = details.Split(AutomationMaster.DELIMITER);
            for (int i = 0; i < detailsEach.Length; i++)
            {
                string[] keyVal = detailsEach[i].Split('=');
                if (BuddyTestRequiredDetails.FindAll(x => x.Key == keyVal[0]).Any())
                {
                    BuddyTestRequiredDetails.Remove(BuddyTestRequiredDetails.Find(x => x.Key == keyVal[0]));
                }
                BuddyTestRequiredDetails.Add(new KeyValuePair <string, string>(keyVal[0], keyVal[1]));
            }
        }