static void Test() { _connection = new OServer(_hostname, _port, _rootName, _rootPassword); if (!_connection.DatabaseExist(_databaseName)) { _connection.CreateDatabase(_databaseName, ODatabaseType.Document, OStorageType.Local); } try { using (ODatabase database = new ODatabase(_hostname, _port, _databaseName, ODatabaseType.Document, _username, _password)) { Console.WriteLine("Session ID: {0}", database.SessionID); } } catch (OException ex) { //Console.WriteLine("{0}: {1}", ex.Type, ex.Description); } finally { // delete test database _connection.DeleteDatabase(_databaseName); _connection.Close(); } }
public void TestServerDatabaseNotExist() { using (OServer connection = new OServer(_hostname, _port, _rootName, _rootPassword)) { Assert.IsFalse(connection.DatabaseExist("whateverThisShouldNotExist001x")); } }
public void TestServerDatabaseExist() { using (OServer connection = new OServer(_hostname, _port, _rootName, _rootPassword)) { connection.CreateDatabase(_databaseName, ODatabaseType.Document, OStorageType.Local); Assert.IsTrue(connection.DatabaseExist(_databaseName)); connection.DeleteDatabase(_databaseName); } }
public ODatabaseTests() { _connection = new OServer(_hostname, _port, _rootName, _rootPassword); // if database exists, delete it if (_connection.DatabaseExist(_databaseName)) { _connection.DeleteDatabase(_databaseName); } _connection.CreateDatabase(_databaseName, ODatabaseType.Document, OStorageType.Local); }
public ODatabasePoolTests() { _connection = new OServer(_hostname, _port, _rootName, _rootPassword); // if database exists, delete it if (_connection.DatabaseExist(_databaseName)) { _connection.DeleteDatabase(_databaseName); } _connection.CreateDatabase(_databaseName, ODatabaseType.Document, OStorageType.Local); // create database pool EasternClient.CreateDatabasePool(_hostname, _port, _databaseName, ODatabaseType.Document, _username, _password, _poolSize, _poolAlias); }