Inheritance: IDisposable
示例#1
0
 public void TestServerDatabaseNotExist()
 {
     using (OServer connection = new OServer(_hostname, _port, _rootName, _rootPassword))
     {
         Assert.IsFalse(connection.DatabaseExist("whateverThisShouldNotExist001x"));
     }
 }
示例#2
0
        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();
            }
        }
示例#3
0
 public void TestServerConnect()
 {
     using (OServer connection = new OServer(_hostname, _port, _rootName, _rootPassword))
     {
         Assert.IsTrue(connection.SessionID > 0);
     }
 }
示例#4
0
        public void TestServerCloseConnection()
        {
            using (OServer connection = new OServer(_hostname, _port, _rootName, _rootPassword))
            {
                connection.Close();

                Assert.IsTrue(connection.SessionID == -1);
            }
        }
示例#5
0
        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);
            }
        }
示例#6
0
        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);
        }
示例#7
0
        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);
        }