private static IList <QaError> GetErrors([NotNull] string tableName, int maximumLength) { var locator = TestDataUtils.GetTestDataLocator(); string path = locator.GetPath("QaSchemaTests.mdb"); IFeatureWorkspace workspace = WorkspaceUtils.OpenPgdbFeatureWorkspace(path); const int minimumValueCount = 1; const int minimumNonEqualNameValueCount = 1; const bool allowEmptyName = false; ITable table = workspace.OpenTable(tableName); var test = new QaSchemaFieldDomainCodedValues(table, maximumLength, UniqueStringsConstraint.UniqueAnyCase, minimumValueCount, minimumNonEqualNameValueCount, allowEmptyName); var runner = new QaTestRunner(test); runner.Execute(); return(runner.Errors); }
public void Gen2847_NonZawarePolylineWithInteriorLoops() { var locator = TestDataUtils.GetTestDataLocator(); string path = locator.GetPath("DKM25_HOEHENKURVE_OID_2178.xml"); var nonZAwarePolyline = (IPolyline)GeometryUtils.FromXmlFile(path); var fc = new FeatureClassMock(1, "Contours", esriGeometryType.esriGeometryPolyline, esriFeatureType.esriFTSimple, nonZAwarePolyline.SpatialReference, hasZ: false, hasM: false); IFeature f = fc.CreateFeature(nonZAwarePolyline); const double toleranceFactor = 1.0; var test = new QaSimpleGeometry(fc, false, toleranceFactor); var runner = new QaTestRunner(test) { KeepGeometry = true }; runner.Execute(f); Assert.AreEqual(1, runner.Errors.Count); Assert.AreEqual(3, ((IPointCollection)runner.ErrorGeometries[0]).PointCount); }
public void CanHandleZeroLengthEndSegments() { const string featureClassName = "TLM_STEHENDES_GEWAESSER"; var locator = TestDataUtils.GetTestDataLocator(); string path = locator.GetPath("QaBorderSense.gdb"); IFeatureWorkspace workspace = WorkspaceUtils.OpenFileGdbFeatureWorkspace(path); IFeatureClass featureClass = workspace.OpenFeatureClass(featureClassName); // expect counter-clockwise: 0 errors var runnerCounterClockwise = new QaContainerTestRunner(1000, new QaBorderSense( featureClass, false)); Assert.AreEqual(0, runnerCounterClockwise.Execute()); // expect clockwise: 1 error var runnerClockwise = new QaContainerTestRunner(1000, new QaBorderSense(featureClass, true)); Assert.AreEqual(1, runnerClockwise.Execute()); }
private static IList <QaError> GetErrors([NotNull] string tableName) { var locator = TestDataUtils.GetTestDataLocator(); string path = locator.GetPath("QaSchemaTests.mdb"); IFeatureWorkspace workspace = WorkspaceUtils.OpenPgdbFeatureWorkspace(path); ITable table = workspace.OpenTable(tableName); var test = new QaSchemaFieldDomains(table); var runner = new QaTestRunner(test); runner.Execute(); return(runner.Errors); }
private static IList <QaError> GetErrors([NotNull] string tableName) { var locator = TestDataUtils.GetTestDataLocator(); string path = locator.GetPath("QaSchemaTests.mdb"); IFeatureWorkspace workspace = WorkspaceUtils.OpenPgdbFeatureWorkspace(path); ITable table = workspace.OpenTable(tableName); ITable reservedNamesTable = workspace.OpenTable("ReservedFieldNames"); var test = new QaSchemaReservedFieldNames(table, reservedNamesTable, "ReservedWord", "Reason", "ValidFieldName"); var runner = new QaTestRunner(test); runner.Execute(); return(runner.Errors); }
private static IList <QaError> GetErrors([NotNull] string tableName, [NotNull] string pattern, bool matchIsError, [CanBeNull] string patternDescription) { var locator = TestDataUtils.GetTestDataLocator(); string path = locator.GetPath("QaSchemaTests.mdb"); IFeatureWorkspace workspace = WorkspaceUtils.OpenPgdbFeatureWorkspace(path); ITable table = workspace.OpenTable(tableName); var test = new QaSchemaFieldDomainNameRegex(table, pattern, matchIsError, patternDescription); var runner = new QaTestRunner(test); runner.Execute(); return(runner.Errors); }
private static IList <QaError> GetErrors([NotNull] string tableName, int maximumLength, ExpectedCase expectedCase, int uniqueSubstringLength) { var locator = TestDataUtils.GetTestDataLocator(); string path = locator.GetPath("QaSchemaTests.mdb"); IFeatureWorkspace workspace = WorkspaceUtils.OpenPgdbFeatureWorkspace(path); ITable table = workspace.OpenTable(tableName); var test = new QaSchemaFieldNames(table, maximumLength, expectedCase, uniqueSubstringLength); var runner = new QaTestRunner(test); runner.Execute(); return(runner.Errors); }
private static IList <QaError> GetErrors([NotNull] string tableName) { var locator = TestDataUtils.GetTestDataLocator(); string path = locator.GetPath("QaSchemaTests.mdb"); IFeatureWorkspace workspace = WorkspaceUtils.OpenPgdbFeatureWorkspace(path); ITable table = workspace.OpenTable(tableName); ITable fieldSpecificationsTable = workspace.OpenTable("S_011"); const bool matchAliasName = true; var test = new QaSchemaFieldPropertiesFromTable(table, fieldSpecificationsTable, matchAliasName); var runner = new QaTestRunner(test); runner.Execute(); return(runner.Errors); }
private static IList <QaError> Execute(double tileSize) { var locator = TestDataUtils.GetTestDataLocator(); string path = locator.GetPath("QaPartCoincidenceVolumeTest.mdb"); IFeatureWorkspace ws = WorkspaceUtils.OpenPgdbFeatureWorkspace(path); IFeatureClass featureClass = ws.OpenFeatureClass("BigPolygons"); var test = new QaPartCoincidenceSelf(featureClass, 10, 40, false); var runner = new QaContainerTestRunner(tileSize, test); IEnvelope box = new EnvelopeClass(); box.PutCoords(2480190, 1134100, 2497430, 1140500); runner.Execute(box); return(runner.Errors); }
private static IList <QaError> GetErrors([NotNull] string tableName, int maximumLength, ExpectedCase expectedCase, bool requireUnique, bool allowCustomSystemFieldAlias, ExpectedStringDifference expectedStringDifference) { var locator = TestDataUtils.GetTestDataLocator(); string path = locator.GetPath("QaSchemaTests.mdb"); IFeatureWorkspace workspace = WorkspaceUtils.OpenPgdbFeatureWorkspace(path); ITable table = workspace.OpenTable(tableName); var test = new QaSchemaFieldAliases(table, maximumLength, expectedCase, requireUnique, allowCustomSystemFieldAlias, expectedStringDifference); var runner = new QaTestRunner(test); runner.Execute(); return(runner.Errors); }