Skip to content

Generates C# code for ArcGIS geodatabase structure creation and data access objects in for in-memory unit tests

License

Notifications You must be signed in to change notification settings

r-pankevicius/ArcObjectsCodeGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArcObjectsCodeGen

Generates C# code for ArcGIS geodatabase structure creation and data access objects in for in-memory unit tests.

You can put real data under unit test to verify your code.

You don't need a full integration test (well, leave it for the night build) and can run tests in memory (InMemoryWorkspaceFactoryClass).

CLI command samples

ArcObjectsCodeGen AO.FeatureClass ConnectionFile.sde FeatureClassName --output-folder generated-code

Generates code to create a feature class.

ArcObjectsCodeGen AO.Feature ConnectionFile.sde FeatureClassName --query "OBJECTID IN (1024, 1033)" --output-folder generated-code

Generates feature samples.

Notes

Just started, many TODO-s (most wanted: -namespace param).

Aquire ArcGIS license when running the test, release afterwards. You can use this class.

Run each test in STA thread. A single test will run fine in MTA but you may into issues when running multiple tests in parallel. For XUnit there is Xunit.StaFact by Andrew Arnott to solve this.

When running tests in STA thread avoid any ArcObjects COM object caching in static members as it may be created in another appartments. You'll get some COM interop exception.

License

Apache License Version 2.0, see LICENSE.

About

Generates C# code for ArcGIS geodatabase structure creation and data access objects in for in-memory unit tests

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published