private static IFeatureWorkspace CreateTestWorkspace(
            [NotNull] string fgdbName,
            [NotNull] string fcName, [NotNull] string tableName, [NotNull] string relClassName,
            [NotNull] out IFeatureClass fc,
            [NotNull] out ITable table,
            [NotNull] out IRelationshipClass rc)
        {
            IFeatureWorkspace ws = TestWorkspaceUtils.CreateTestFgdbWorkspace(fgdbName);

            ISpatialReference sref = SpatialReferenceUtils.CreateSpatialReference(
                (int)esriSRProjCS2Type.esriSRProjCS_CH1903Plus_LV95, true);

            fc = DatasetUtils.CreateSimpleFeatureClass(
                ws, fcName, null,
                FieldUtils.CreateOIDField(),
                FieldUtils.CreateIntegerField("FKEY"),
                FieldUtils.CreateShapeField(
                    "SHAPE", esriGeometryType.esriGeometryPoint,
                    sref, 1000));

            table = DatasetUtils.CreateTable(ws, tableName,
                                             FieldUtils.CreateOIDField(),
                                             FieldUtils.CreateTextField("TEXT", 100));

            rc = TestWorkspaceUtils.CreateSimple1NRelationship(
                ws, relClassName,
                table, (ITable)fc,
                table.OIDFieldName, "FKEY");

            return(ws);
        }
        public void TestTopgisTMultiPatches()
        {
            IWorkspace workspace = TestDataUtils.OpenTopgisTlm();

            IFeatureClass gebaeude =
                ((IFeatureWorkspace)workspace).OpenFeatureClass(
                    "TOPGIS_TLM.TLM_GEBAEUDE");

            var test = new QaMpVertexNotNearFace(
                gebaeude, new[] { gebaeude }, 1, 0.2);

            test.VerifyWithinFeature    = true;
            test.PointCoincidence       = 0.1;
            test.EdgeCoincidence        = 0.1;
            test.IgnoreNonCoplanarFaces = true;
            test.MinimumSlopeDegrees    = 15;

            var runner = new QaContainerTestRunner(10000, test);

            runner.LogErrors = false;

            IFeatureWorkspace ws =
                TestWorkspaceUtils.CreateTestFgdbWorkspace("QaMpVertexNotNearFaceTest");
            var logger = new SimpleErrorWorkspace(ws);

            runner.TestContainer.QaError += logger.TestContainer_QaError;

            runner.Execute();

            Console.WriteLine(runner.Errors.Count);
        }
        public void SetupFixture()
        {
            _lic.Checkout();

            _testWs = TestWorkspaceUtils.CreateTestFgdbWorkspace(
                "GdbConstraintUtilsTest");
        }
Example #4
0
        public void SetupFixture()
        {
            _lic.Checkout();

            _largeData = GetMultiPatch(50000);

            _testWs = TestWorkspaceUtils.CreateTestFgdbWorkspace("TestMultipatchUtils");
        }
        public void SetupFixture()
        {
            _lic.Checkout();

            _testWs = TestWorkspaceUtils.CreateTestAccessWorkspace("QaGroupConstraintsTest");
            _fgdbWs =
                TestWorkspaceUtils.CreateTestFgdbWorkspace("QaGroupConstraintsTest");
        }
Example #6
0
        public void SetupFixture()
        {
            _lic.Checkout();

            const string databaseName = "TestUnique";

            _pgdbWorkspace = TestWorkspaceUtils.CreateTestAccessWorkspace(databaseName);
            _fgdbWorkspace = TestWorkspaceUtils.CreateTestFgdbWorkspace(databaseName);
        }
        public void CanTestEmptyGeometryFgdbPolyline()
        {
            IFeatureWorkspace featureWorkspace =
                TestWorkspaceUtils.CreateTestFgdbWorkspace("EmptyPolyline");

            IFeature feature =
                CreateEmptyGeometryFeature(featureWorkspace, esriGeometryType.esriGeometryPolyline);

            AssertOneErrorEmptyGeometry((IFeatureClass)feature.Class);
        }
        public void CanTestEmptyGeometryFgdbMultipatch()
        {
            IFeatureWorkspace featureWorkspace =
                TestWorkspaceUtils.CreateTestFgdbWorkspace("EmptyMultipatch");

            IFeature feature =
                CreateEmptyGeometryFeature(featureWorkspace,
                                           esriGeometryType.esriGeometryMultiPatch);

            AssertOneErrorEmptyGeometry((IFeatureClass)feature.Class);
        }
        public void SetupFixture()
        {
            _lic.Checkout();

            _testWs = TestWorkspaceUtils.CreateTestFgdbWorkspace("QaMeasuresAtPointsTest");
        }
Example #10
0
        public void SetupFixture()
        {
            _lic.Checkout();

            _workspace = TestWorkspaceUtils.CreateTestFgdbWorkspace(GetType().Name);
        }
Example #11
0
 public void Setup()
 {
     _workspace = TestWorkspaceUtils.CreateTestFgdbWorkspace(GetType().Name);
 }
Example #12
0
        public void SetupFixture()
        {
            _lic.Checkout();

            _testWs = TestWorkspaceUtils.CreateTestFgdbWorkspace("QaPointOnLineTest");
        }
        public void SetupFixture()
        {
            _lic.Checkout();

            _testWs = TestWorkspaceUtils.CreateTestFgdbWorkspace("QaDuplicateGeometrySelfTest");
        }
Example #14
0
        public void SetupFixture()
        {
            _lic.Checkout();

            _testWs = TestWorkspaceUtils.CreateTestFgdbWorkspace("TestMinSegmentLength");
        }
Example #15
0
        public void SetupFixture()
        {
            _lic.Checkout();

            _testWs = TestWorkspaceUtils.CreateTestFgdbWorkspace("QaConnectionsTest");
        }
Example #16
0
        public void SetupFixture()
        {
            _lic.Checkout();

            _testWs = TestWorkspaceUtils.CreateTestFgdbWorkspace("TestUnreferencedRows");
        }
Example #17
0
        public void SetupFixture()
        {
            _lic.Checkout();

            _workspace = TestWorkspaceUtils.CreateTestFgdbWorkspace("QaForeignKeyTest");
        }
        public void SetupFixture()
        {
            _lic.Checkout();

            TestWorkspaceUtils.CreateTestFgdbWorkspace("QaContainesOtherTest");
        }
        public void SetupFixture()
        {
            _lic.Checkout();

            _testWs = TestWorkspaceUtils.CreateTestFgdbWorkspace("QaContainedPointsCountTest");
        }
Example #20
0
        public void SetupFixture()
        {
            _lic.Checkout();

            _testWs = TestWorkspaceUtils.CreateTestFgdbWorkspace("TestZRange");
        }
        public void DuplicatesInOtherWorkspace()
        {
            IDomain domain1 = DomainUtils.AddDomain(_workspace,
                                                    DomainUtils.CreateCodedValueDomain(
                                                        "DOM_FIELD1",
                                                        esriFieldType.esriFieldTypeInteger,
                                                        "Description of DOM_FIELD1",
                                                        new CodedValue(1, "Value 1"),
                                                        new CodedValue(2, "Value 2")));
            IDomain domain2 = DomainUtils.AddDomain(_workspace,
                                                    DomainUtils.CreateCodedValueDomain(
                                                        "DOM_FIELD2",
                                                        esriFieldType.esriFieldTypeInteger,
                                                        "Description of DOM_FIELD2",
                                                        new CodedValue(1, "Value 1"),
                                                        new CodedValue(2, "Value 2")));

            // domain (not used in table) with duplicate name - this should not be reported since duplicates are searched in target (?)
            DomainUtils.AddDomain(_workspace,
                                  DomainUtils.CreateCodedValueDomain("DOM_FIELD3",
                                                                     esriFieldType
                                                                     .esriFieldTypeInteger,
                                                                     "Description of DOM_FIELD2",
                                                                     new CodedValue(1,
                                                                                    "Value 1"),
                                                                     new CodedValue(2,
                                                                                    "Value 2")));

            IField field1 = FieldUtils.CreateField("FIELD1", esriFieldType.esriFieldTypeInteger);
            IField field2 = FieldUtils.CreateField("FIELD2", esriFieldType.esriFieldTypeInteger);
            IField field3 = FieldUtils.CreateTextField("FIELD3", 20);

            ((IFieldEdit)field1).Domain_2 = domain1;
            ((IFieldEdit)field2).Domain_2 = domain2;

            ITable table = DatasetUtils.CreateTable(_workspace,
                                                    MethodBase.GetCurrentMethod().Name,
                                                    FieldUtils.CreateOIDField(),
                                                    field1, field2, field3);

            // add domains/table to target workspace

            IFeatureWorkspace targetWorkspace =
                TestWorkspaceUtils.CreateTestFgdbWorkspace($"{GetType().Name}_target");

            // same name, same description --> should be considered equal, no duplicate
            DomainUtils.AddDomain(targetWorkspace,
                                  DomainUtils.CreateCodedValueDomain("DOM_FIELD1",
                                                                     esriFieldType
                                                                     .esriFieldTypeInteger,
                                                                     "Description of DOM_FIELD1",
                                                                     new CodedValue(1,
                                                                                    "Value 1"),
                                                                     new CodedValue(2,
                                                                                    "Value 2")));

            // different name, same description --> should be reported
            DomainUtils.AddDomain(targetWorkspace,
                                  DomainUtils.CreateCodedValueDomain("DOM_FIELD4",
                                                                     esriFieldType
                                                                     .esriFieldTypeInteger,
                                                                     "Description of DOM_FIELD2",
                                                                     new CodedValue(1,
                                                                                    "Value 1"),
                                                                     new CodedValue(2,
                                                                                    "Value 2")));

            // different name, same description --> should be reported
            DomainUtils.AddDomain(targetWorkspace,
                                  DomainUtils.CreateRangeDomain("DOM_FIELD5",
                                                                esriFieldType.esriFieldTypeInteger,
                                                                0, 100,
                                                                "Description of DOM_FIELD2"));

            ITable targetTable = DatasetUtils.CreateTable(targetWorkspace,
                                                          MethodBase.GetCurrentMethod().Name,
                                                          FieldUtils.CreateOIDField(),
                                                          FieldUtils.CreateTextField("FIELD1",
                                                                                     10));

            const int  maxLength    = 25;
            const bool noDuplicates = true;
            var        runner       =
                new QaTestRunner(new QaSchemaFieldDomainDescriptions(table, maxLength,
                                                                     noDuplicates,
                                                                     targetTable));

            runner.Execute();

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