so any advice on this error: Failed InitGeoDataServerFromWorkspaceTest TestPostReconcile Test method TestPostReconcile.ArcSDEUtilitiesTest.InitGeoDataServerFromWorkspaceTest threw exception: System.InvalidCastException: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). The code: private IGeoDataServer InitGeoDataServerFromWorkspace(IWorkspace geodatabase)
{
// Create the GeoDataServer and cast to the the IGeoDataServerInit interface.
IGeoDataServer geoDataServer = new GeoDataServerClass();
IGeoDataServerInit geoDataServerInit = (IGeoDataServerInit)geoDataServer;
// Initialize the GeoDataServer and return it.
geoDataServerInit.InitWithWorkspace(geodatabase);
return geoDataServer;
}
The test: [TestMethod()]
//[DeploymentItem("Batch Reconcile and Post.exe")]
public void InitGeoDataServerFromWorkspaceTest()
{
ArcSDEUtilities_Accessor target = new ArcSDEUtilities_Accessor();
IWorkspace geodatabase = (IWorkspace)iworkspacemock.MockInstance;
IGeoDataServer expected = (IGeoDataServer)geodataservermock.MockInstance;
IGeoDataServer actual;
actual = target.InitGeoDataServerFromWorkspace(geodatabase);
Assert.AreEqual(expected, actual);
}
the initialize logic helped clear my first hurdle with this. thanks much for that. I'm just getting tripped up on how this all plays out, I'm brand new to unit testing (been trying to implement for about a year now, just getting to it).