public void TestSHP() { IConnectionManager connMgr = FdoFeatureAccessManager.GetConnectionManager(); FdoIConnection conn = connMgr.CreateConnection("OSGeo.SHP"); conn.ConnectionString = "DefaultFileLocation=" + TestDataStore.SHP; Assert.Equal(FdoConnectionState.FdoConnectionState_Open, conn.Open()); conn.Close(); conn.ConnectionString = "DefaultFileLocation=" + TestDataStore.SHP_DIR; Assert.Equal(FdoConnectionState.FdoConnectionState_Open, conn.Open()); conn.Close(); conn.ConnectionString = "File=../IDontExist.shp"; Assert.Throws <ManagedFdoException>(() => { FdoConnectionState state = conn.Open(); }); }
public void TestSQLite() { IConnectionManager connMgr = FdoFeatureAccessManager.GetConnectionManager(); FdoIConnection conn = connMgr.CreateConnection("OSGeo.SQLite"); conn.ConnectionString = "File=" + TestDataStore.SQLITE; Assert.Equal(FdoConnectionState.FdoConnectionState_Open, conn.Open()); conn.Close(); conn.ConnectionString = "File=../IDontExist.sqlite"; Assert.Throws <ManagedFdoException>(() => { FdoConnectionState state = conn.Open(); }); }
public void TestSQLiteSpatialContext() { IConnectionManager connMgr = FdoFeatureAccessManager.GetConnectionManager(); FdoIConnection conn = connMgr.CreateConnection("OSGeo.SQLite"); conn.ConnectionString = "File=" + TestDataStore.SQLITE; Assert.Equal(FdoConnectionState.FdoConnectionState_Open, conn.Open()); try { DoGetSpatialContexts(conn); } finally { conn.Close(); } }
public void TestSHPSpatialExtents() { IConnectionManager connMgr = FdoFeatureAccessManager.GetConnectionManager(); FdoIConnection conn = connMgr.CreateConnection("OSGeo.SHP"); conn.ConnectionString = "DefaultFileLocation=" + TestDataStore.SHP; Assert.Equal(FdoConnectionState.FdoConnectionState_Open, conn.Open()); try { DoSpatialExtents(conn); DoFilteredSpatialExtents(conn); } finally { conn.Close(); } }
public void TestSDFDistinct() { IConnectionManager connMgr = FdoFeatureAccessManager.GetConnectionManager(); FdoIConnection conn = connMgr.CreateConnection("OSGeo.SDF"); conn.ConnectionString = "File=" + TestDataStore.SDF; Assert.Equal(FdoConnectionState.FdoConnectionState_Open, conn.Open()); try { DoDistinct(conn); DoFilteredDistinct(conn); } finally { conn.Close(); } }
public void TestSHPUpdate() { IConnectionManager connMgr = FdoFeatureAccessManager.GetConnectionManager(); FdoIConnection conn = connMgr.CreateConnection("OSGeo.SHP"); conn.ConnectionString = "DefaultFileLocation=" + SHP; Assert.Equal(FdoConnectionState.FdoConnectionState_Open, conn.Open()); try { DoUpdate(conn); } finally { conn.Close(); } }
public void TestSQLiteSelectFiltered() { IConnectionManager connMgr = FdoFeatureAccessManager.GetConnectionManager(); FdoIConnection conn = connMgr.CreateConnection("OSGeo.SQLite"); conn.ConnectionString = "File=" + TestDataStore.SQLITE; Assert.Equal(FdoConnectionState.FdoConnectionState_Open, conn.Open()); try { FdoISelect selectCmd = conn.CreateCommand((int)FdoCommandType.FdoCommandType_Select) as FdoISelect; Assert.NotNull(selectCmd); TestFilteredSelectCommand(selectCmd); } finally { conn.Close(); } }