Esempio n. 1
0
        public void CanFindDifferingParts()
        {
            IFeatureClass featureClass = CreateLineClass(TestWorkspace);

            IPolycurve line1 =
                CurveConstruction.StartLine(0, 0, 5)
                .LineTo(1, 0, 6)
                .LineTo(1.5, 0, 6)
                .LineTo(2, 0, 6)
                .LineTo(3, 0, 7)
                .LineTo(3.2, 0, 6.8)
                .LineTo(3.5, 0, 6.5)
                .LineTo(4, 0, 6)
                .LineTo(5, 0, 7)
                .LineTo(6, 0, 7)
                .Curve;
            IFeature row1 = featureClass.CreateFeature();

            row1.Shape = line1;
            row1.Store();

            var test = new QaMonotonicZ(featureClass)
            {
                AllowConstantValues  = false,
                ExpectedMonotonicity = MonotonicityDirection.Increasing
            };
            var runner = new QaTestRunner(test);

            runner.Execute(row1);
            Assert.AreEqual(3, runner.Errors.Count);
        }
Esempio n. 2
0
        public void CanUseFlipExpression()
        {
            IFeatureClass featureClass = CreateLineClass(TestWorkspace);

            IFeature row1 = featureClass.CreateFeature();

            row1.Shape = CurveConstruction.StartLine(0, 0, 5).LineTo(1, 0, 6).Curve;
            row1.set_Value(row1.Fields.FindField(_flipFieldName), 1);
            row1.Store();

            IFeature row2 = featureClass.CreateFeature();

            row2.Shape = CurveConstruction.StartLine(0, 0, 5).LineTo(1, 0, 6).Curve;
            row2.set_Value(row2.Fields.FindField(_flipFieldName), -1);
            row2.Store();

            IFeature row3 = featureClass.CreateFeature();

            row3.Shape = CurveConstruction.StartLine(0, 0, 6).LineTo(1, 0, 5).Curve;
            row3.Store();

            var test = new QaMonotonicZ(featureClass)
            {
                AllowConstantValues  = false,
                ExpectedMonotonicity = MonotonicityDirection.Decreasing,
                FlipExpression       = string.Format("{0} > 0", _flipFieldName)
            };
            var runner = new QaTestRunner(test);

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