示例#1
0
        public void CanTestLoopEndPoints()
        {
            IFeatureWorkspace ws =
                TestWorkspaceUtils.CreateInMemoryWorkspace("CanTestLoopEndPoints");
            IFeatureClass fc = CreateLineClass(ws);

            IFeature row1 = fc.CreateFeature();

            row1.Shape =
                CurveConstruction.StartLine(0, 0).LineTo(1, 1).LineTo(1, 0).LineTo(0, 0).Curve;
            row1.set_Value(fc.Fields.FindField(_nrFieldName), 1);
            row1.Store();

            var test = new QaPseudoNodes(fc, new string[] { });

            var runner = new QaTestRunner(test);

            runner.Execute();
            Assert.AreEqual(1, runner.Errors.Count);

            test.IgnoreLoopEndpoints = true;
            runner = new QaTestRunner(test);
            runner.Execute();
            Assert.AreEqual(0, runner.Errors.Count);
        }
        protected override ITest CreateTestInstance(object[] args)
        {
            var test = new QaPseudoNodes((IList <IFeatureClass>)args[0],
                                         (string[][])args[1],
                                         (IList <IFeatureClass>)args[2]);

            if (args.Length > 3 && args[3] is bool)
            {
                test.IgnoreLoopEndpoints = (bool)args[3];
            }

            return(test);
        }