예제 #1
0
        public XmlTest Create(XmlTestInfo testInfo, double tolerance)
        {
            XmlTest xmlTest = new XmlTest(testInfo.GetValue("desc"), 
                testInfo.IsDefaultTarget(), tolerance, _geometryOperation, _resultMatcher);

            // Handle test type or name.
            string strTestType = testInfo.GetValue("name");
            if (string.IsNullOrEmpty(strTestType))
                return null;
            
            ParseType(strTestType, xmlTest);

            // Handle the Geometry A:
            string wkt = testInfo.GetValue("a");
            if (!string.IsNullOrEmpty(wkt))
                ParseGeometry(Target.A, wkt, xmlTest);
            
            // Handle the Geometry B:
            wkt = testInfo.GetValue("b");
            if (!string.IsNullOrEmpty(wkt))           
                ParseGeometry(Target.B, wkt, xmlTest);

            string arg2 = testInfo.GetValue("arg2");
            if (!string.IsNullOrEmpty(arg2))
            {
                if (arg2 == "a" || arg2 == "A")
                    xmlTest.Argument1 = xmlTest.A;
                else if (arg2 == "b" || arg2 == "B")
                    xmlTest.Argument1 = xmlTest.B;
                else
                    xmlTest.Argument1 = arg2;
            }

            string arg3 = testInfo.GetValue("arg3");
            if (!string.IsNullOrEmpty(arg3))
                xmlTest.Argument2 = arg3;



            string strResult = testInfo.GetValue("result");
            if (string.IsNullOrEmpty(strResult))
                return null;

            ParseResult(strResult, xmlTest);

            return xmlTest;
        }
예제 #2
0
        public XmlTest Create(XmlTestInfo testInfo, double tolerance)
        {
            XmlTest xmlTest = new XmlTest(testInfo.GetValue("desc"), 
                testInfo.IsDefaultTarget(), tolerance);

            // Handle test type or name.
            string strTestType = testInfo.GetValue("name");
            if (strTestType == null || strTestType.Length == 0)
                return null;
            
            ParseType(strTestType, xmlTest);

            // Handle the Geometry A:
            string wktA = testInfo.GetValue("a");
            if (wktA != null && wktA.Length > 0)
                ParseGeometry(Target.A, wktA, xmlTest);
            
            // Handle the Geometry B:
            string wktB = testInfo.GetValue("b");
            if (wktB != null && wktB.Length > 0)           
                ParseGeometry(Target.B, wktB, xmlTest);            

            // Handle the arguments
            string arg2 = testInfo.GetValue("arg2");
            if (arg2 != null && arg2.Length > 0)
            {
                if (arg2 == "a")
                    xmlTest.Argument1 = xmlTest.A;
                else if (arg2 == "b")
                    xmlTest.Argument1 = xmlTest.B;
            }

            string arg3 = testInfo.GetValue("arg3");
            if (arg3 != null && arg3.Length > 0)            
                xmlTest.Argument2 = arg3;

            string strResult = testInfo.GetValue("result");
            if (strResult == null || strResult.Length == 0)
                return null;

            ParseResult(strResult, xmlTest);

            return xmlTest;
        }
예제 #3
0
        public XmlTest Create(XmlTestInfo testInfo, double tolerance)
        {
            XmlTest xmlTest = new XmlTest(testInfo.GetValue("desc"),
                                          testInfo.IsDefaultTarget(), tolerance);

            // Handle test type or name.
            string strTestType = testInfo.GetValue("name");

            if (strTestType == null || strTestType.Length == 0)
            {
                return(null);
            }

            ParseType(strTestType, xmlTest);

            // Handle the Geometry A:
            string wktA = testInfo.GetValue("a");

            if (wktA != null && wktA.Length > 0)
            {
                ParseGeometry(Target.A, wktA, xmlTest);
            }

            // Handle the Geometry B:
            string wktB = testInfo.GetValue("b");

            if (wktB != null && wktB.Length > 0)
            {
                ParseGeometry(Target.B, wktB, xmlTest);
            }

            // Handle the arguments
            string arg2 = testInfo.GetValue("arg2");

            if (arg2 != null && arg2.Length > 0)
            {
                if (arg2 == "a")
                {
                    xmlTest.Argument1 = xmlTest.A;
                }
                else if (arg2 == "b")
                {
                    xmlTest.Argument1 = xmlTest.B;
                }
            }

            string arg3 = testInfo.GetValue("arg3");

            if (arg3 != null && arg3.Length > 0)
            {
                xmlTest.Argument2 = arg3;
            }

            string strResult = testInfo.GetValue("result");

            if (strResult == null || strResult.Length == 0)
            {
                return(null);
            }

            ParseResult(strResult, xmlTest);

            return(xmlTest);
        }
        public XmlTest Create(XmlTestInfo testInfo, double tolerance)
        {
            XmlTest xmlTest = new XmlTest(testInfo.GetValue("desc"),
                                          testInfo.IsDefaultTarget(), tolerance, _geometryOperation, _resultMatcher);

            // Handle test type or name.
            string strTestType = testInfo.GetValue("name");

            if (string.IsNullOrEmpty(strTestType))
            {
                return(null);
            }

            ParseType(strTestType, xmlTest);

            // Handle the Geometry A:
            string wkt = testInfo.GetValue("a");

            if (!string.IsNullOrEmpty(wkt))
            {
                ParseGeometry(Target.A, wkt, xmlTest);
            }

            // Handle the Geometry B:
            wkt = testInfo.GetValue("b");
            if (!string.IsNullOrEmpty(wkt))
            {
                ParseGeometry(Target.B, wkt, xmlTest);
            }

            string arg2 = testInfo.GetValue("arg2");

            if (!string.IsNullOrEmpty(arg2))
            {
                if (arg2 == "a" || arg2 == "A")
                {
                    xmlTest.Argument1 = xmlTest.A;
                }
                else if (arg2 == "b" || arg2 == "B")
                {
                    xmlTest.Argument1 = xmlTest.B;
                }
                else
                {
                    xmlTest.Argument1 = arg2;
                }
            }

            string arg3 = testInfo.GetValue("arg3");

            if (!string.IsNullOrEmpty(arg3))
            {
                xmlTest.Argument2 = arg3;
            }

            string strResult = testInfo.GetValue("result");

            if (string.IsNullOrEmpty(strResult))
            {
                return(null);
            }

            ParseResult(strResult, xmlTest);

            return(xmlTest);
        }