Exemplo n.º 1
0
            public void GetDatabasesPercentTwoResultTest()
            {
                CUBRIDConnection connection = new CUBRIDConnection(); // TODO: Initialize to an appropriate value

                connection.ConnectionString = DBHelper.connString;
                connection.Open();
                CUBRIDSchemaProvider target = new CUBRIDSchemaProvider(connection); // TODO: Initialize to an appropriate value

                string[]  filters  = new string[] { "%demo%" };                     // TODO: Initialize to an appropriate value
                DataTable expected = new DataTable();                               // TODO: Initialize to an appropriate value

                DataTable actual;

                actual = target.GetDatabases(filters);
                Assert.AreEqual(1, actual.Rows.Count);
            }
Exemplo n.º 2
0
        /// <summary>
        /// Test CUBRIDSchemaProvider GetDatabases() method
        /// </summary>
        private static void Test_GetDatabases()
        {
            using (CUBRIDConnection conn = new CUBRIDConnection())
            {
                conn.ConnectionString = TestCases.connString;
                conn.Open();

                CUBRIDSchemaProvider schema = new CUBRIDSchemaProvider(conn);
                DataTable            dt     = schema.GetDatabases(new string[] { "demo%" });

                Debug.Assert(dt.Columns.Count == 2);
                Debug.Assert(dt.Rows.Count >= 1);

                Debug.Assert(dt.Rows[0][0].ToString() == "demodb");
                Debug.Assert(dt.Rows[0][1].ToString() == "demodb");
            }
        }
Exemplo n.º 3
0
            public void GetDatabasesTwoFilterExceptionTest()
            {
                CUBRIDConnection connection = new CUBRIDConnection(); // TODO: Initialize to an appropriate value

                connection.ConnectionString = DBHelper.connString;
                connection.Open();
                CUBRIDSchemaProvider target = new CUBRIDSchemaProvider(connection); // TODO: Initialize to an appropriate value

                string[]  filters  = new string[] { "demodb", "demodb2" };          // TODO: Initialize to an appropriate value
                DataTable expected = new DataTable();                               // TODO: Initialize to an appropriate value

                DataTable actual;
                string    ss = null;

                try
                {
                    actual = target.GetDatabases(filters);
                }
                catch (ArgumentException e)
                {
                    ss = e.Message;
                }
                Assert.IsNotNull(ss.Length);
            }