Exemple #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);
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Get source segment names for the given source test
 /// </summary>
 /// <param name="sSourceTestName"></param>
 /// <returns></returns>
 public List <string> GetSourceSegmentNames(string sSourceTestName)
 {
     return(SourceTestToSourceSegmentNamesMap.ContainsKey(sSourceTestName) ? SourceTestToSourceSegmentNamesMap[sSourceTestName].ToList() : new List <string>());
 }