Ejemplo n.º 1
0
        public void TestMultipatch()
        {
            IFeatureClass featureClass =
                TestWorkspaceUtils.CreateSimpleFeatureClass(
                    _testWs, "TestMultipatch", null, esriGeometryType.esriGeometryMultiPatch,
                    esriSRProjCS2Type.esriSRProjCS_CH1903Plus_LV95, 0.001, true);

            // make sure the table is known by the workspace
            ((IWorkspaceEdit)_testWs).StartEditing(false);
            ((IWorkspaceEdit)_testWs).StopEditing(true);

            {
                // Create error Feature
                IFeature     row = featureClass.CreateFeature();
                const double x   = 2600000;
                const double y   = 1200000;
                const double z   = 500;
                row.Shape = new MultiPatchConstruction().StartRing(x, y, z)
                            .Add(x + 0.3, y, z)
                            .Add(x + 0.3, y, z + 10)
                            .MultiPatch;

                row.Store();
            }

            var test = new QaSegmentLength(featureClass, 0.5);

            test.QaError += Test_QaFormatError;
            _errorCount   = 0;
            test.Execute();
            Assert.AreEqual(1, _errorCount);
        }
Ejemplo n.º 2
0
        public void TestFormat()
        {
            CultureInfo origCulture = Thread.CurrentThread.CurrentCulture;

            try
            {
                Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

                IFeatureClass featureClass =
                    TestWorkspaceUtils.CreateSimpleFeatureClass(_testWs,
                                                                "TestFormat", null,
                                                                esriGeometryType
                                                                .esriGeometryPolyline,
                                                                esriSRProjCS2Type
                                                                .esriSRProjCS_CH1903Plus_LV95);

                // make sure the table is known by the workspace
                ((IWorkspaceEdit)_testWs).StartEditing(false);
                ((IWorkspaceEdit)_testWs).StopEditing(true);

                {
                    // Create error Feature
                    IFeature     row = featureClass.CreateFeature();
                    const double x   = 2600000;
                    const double y   = 1200000;
                    row.Shape =
                        GeometryFactory.CreateLine(
                            GeometryFactory.CreatePoint(x, y),
                            GeometryFactory.CreatePoint(x + 0.3, y));
                    row.Store();
                }

                var test = new QaSegmentLength(featureClass, 0.5, false);
                test.QaError += Test_QaFormatError;
                _errorCount   = 0;
                test.Execute();
                Assert.AreEqual(1, _errorCount);
            }
            finally
            {
                Thread.CurrentThread.CurrentCulture = origCulture;
            }
        }