Exemple #1
0
 public UnicodeTestCase(UnicodeTestCaseTypes type, UAUnicodeChar target, UAUnicodeChar source, string description)
 {
     this.type = type;
     this.target = target;
     this.sourcePoint = source;
     this.enabled = true;
     this.description = description;
 }
Exemple #2
0
 public UnicodeTestCase(UnicodeTestCaseTypes type, UAUnicodeChar target, UAUnicodeChar source, string description)
 {
     this.type        = type;
     this.target      = target;
     this.sourcePoint = source;
     this.enabled     = true;
     this.description = description;
 }
Exemple #3
0
        public UnicodeTestCases GetMappingsByType(UnicodeTestCaseTypes type)
        {
            UnicodeTestCases ret = new UnicodeTestCases();

            foreach (UnicodeTestCase mapping in this)
            {
                if (mapping.Type == type)
                {
                    ret.Add(mapping);
                }
            }
            return(ret);
        }
Exemple #4
0
        public static UnicodeTestCases LoadUnicodeCharMappingsFromFile(string fPath)
        {
            XmlDocument doc = new XmlDocument();

            UnicodeTestCases list = new UnicodeTestCases();

            try
            {
                doc.Load(fPath);
            }
            catch (FileNotFoundException e)
            {
                Trace.WriteLine(String.Format("Error opening XML document contained test cases: Error {0}", e.Message));
            }

            //Parsing into structures..
            try
            {
                foreach (XmlNode node in doc.SelectNodes("/UnicodeTestMappings/UnicodeTestMapping"))
                {
                    UnicodeTestCaseTypes t = UAUtilities.GetMappingTypeFromString(node.Attributes["Type"].Value);
                    switch (t)
                    {
                    case UnicodeTestCaseTypes.Transformable:
                        list.Add(ParseTransformable(node));
                        break;

                    case UnicodeTestCaseTypes.Traditional:
                        list.Add(ParseTraditional(node));
                        break;

                    case UnicodeTestCaseTypes.Overlong:
                        list.Add(ParseOverlong(node));
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                Trace.WriteLine(String.Format("Error parsing XML Document {0]", e.Message));
                throw e;
            }
            return(list);
        }