Last Updated: February 25, 2016
·
1.35K
· george-silva

Unit testing ArcObjects

To unit test arcobjects, you will need to start the licesing, as you would, if you were creating a standalone application. Without doing that, your test will not run.

This should do the trick, using NUnit attributes (TestFixture, SetUp, etc)

[TestFixture]
public class UnitTestClass
{
[SetUp]
public void Init()
{
var aoInit = new AoInitializeClass();
aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcInfo);
}
}