Пример #1
0
        public void ChangeDatabase_Test()
        {
            using (CUBRIDConnection conn = new CUBRIDConnection())
            {
                conn.ConnectionString = DBHelper.connString;
                conn.Open();

                LogTestStep("Change to a valid database");
                try
                {
                    conn.ChangeDatabase("demodb2");
                }
                catch (Exception ex)
                {
                    Log(ex.Message);
                    LogNotSuported();
                }

                LogTestStep("Change to an invalid database");
                try
                {
                    conn.ChangeDatabase("another");
                }
                catch (Exception ex)
                {
                    Assert.AreEqual("Changing database is not supported in CUBRID. Please open a new connection instead!", ex.Message);
                    LogStepPass();
                }
            }

            LogTestResult();
        }