Esempio n. 1
0
        /// <summary>
        /// Add particular config elements for the target test
        /// </summary>
        /// <param name="sSourceTestName"></param>
        /// <param name="sSourceSegmentName"></param>
        /// <param name="sTargetSegmentName"></param>
        /// <param name="sSourceFormKey"></param>
        /// <param name="sTargetFormKey"></param>
        public void AddConfig(string sSourceTestName,
                              string sSourceSegmentName, string sTargetSegmentName,
                              string sSourceFormKey, string sTargetFormKey)
        {
            // Add the source test to the list of source tests
            if (!SourceTestNamesForMerge.Exists(x => x.Equals(sSourceTestName)))
            {
                SourceTestNamesForMerge.Add(sSourceTestName);
            }

            // Add the source segment to the 'segments list' for source test
            if (SourceTestToSourceSegmentNamesMap.ContainsKey(sSourceTestName))
            {
                SourceTestToSourceSegmentNamesMap[sSourceTestName].Add(sSourceSegmentName);
            }
            else
            {
                HashSet <string> segments = new HashSet <string>();
                segments.Add(sSourceSegmentName);
                SourceTestToSourceSegmentNamesMap.Add(sSourceTestName, segments);
            }

            // Map the source segment to source test name
            if (!SourceSegmentToSourceTestNamesMap.ContainsKey(sSourceSegmentName))
            {
                SourceSegmentToSourceTestNamesMap.Add(sSourceSegmentName, sSourceTestName);
            }

            // Map the source segment to the target segment
            if (!SourceSegmentToTargetSegmentNamesMap.ContainsKey(sSourceSegmentName))
            {
                SourceSegmentToTargetSegmentNamesMap.Add(sSourceSegmentName, sTargetSegmentName);
            }

            // Add the source form to the source segment.
            if (!string.IsNullOrEmpty(sSourceFormKey) && !string.IsNullOrEmpty(sTargetFormKey))
            {
                if (SourceSegmentToSourceFormKeyNamesMap.ContainsKey(sSourceSegmentName))
                {
                    SourceSegmentToSourceFormKeyNamesMap[sSourceSegmentName].Add(sSourceFormKey);
                }
                else
                {
                    HashSet <string> formKeys = new HashSet <string>();
                    formKeys.Add(sSourceFormKey);
                    SourceSegmentToSourceFormKeyNamesMap.Add(sSourceSegmentName, formKeys);
                }

                // Map the source form key to the target form key
                if (!SourceFormToTargetFormKeysMap.ContainsKey(sSourceFormKey))
                {
                    SourceFormToTargetFormKeysMap.Add(sSourceFormKey, sTargetFormKey);
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Get source form keys for the given segment
 /// </summary>
 /// <param name="sSourceSegmentName"></param>
 /// <returns></returns>
 public List <string> GetSourceFormKeys(string sSourceSegmentName)
 {
     return(SourceSegmentToSourceFormKeyNamesMap.ContainsKey(sSourceSegmentName) ? SourceSegmentToSourceFormKeyNamesMap[sSourceSegmentName].ToList() : new List <string>());
 }