public void TestCreateParameterNameGenerator()
 {
     //---------------Set up test pack-------------------
     IDatabaseConnection databaseConnection = new DatabaseConnectionPostgreSql("", "");
     //---------------Assert PreConditions---------------            
     //---------------Execute Test ----------------------
     IParameterNameGenerator generator = databaseConnection.CreateParameterNameGenerator();
     //---------------Test Result -----------------------
     Assert.AreEqual(":", generator.PrefixCharacter);
     //---------------Tear Down -------------------------          
 }
        public void Test_CreateSqlFormatter_AlternateConstructor_PostgreSql()
        {
            //---------------Set up test pack-------------------
            string connectionString =
                new DatabaseConfig(DatabaseConfig.SqlServer, "test", "test", "test", "test", "1000").GetConnectionString();
            IDatabaseConnection dbConn = new DatabaseConnectionPostgreSql
                ("System.Data", "System.Data.SqlClient.SqlConnection", connectionString);
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            ISqlFormatter defaultSqlFormatter = dbConn.SqlFormatter;
            //---------------Test Result -----------------------
            Assert.IsInstanceOf(typeof(SqlFormatter), defaultSqlFormatter);
            SqlFormatter sqlFormatter = (SqlFormatter)defaultSqlFormatter;
            Assert.IsNotNull(sqlFormatter);
            Assert.AreEqual("\"", sqlFormatter.LeftFieldDelimiter);
            Assert.AreEqual("\"", sqlFormatter.RightFieldDelimiter);
            Assert.AreEqual("", sqlFormatter.LimitClauseAtBeginning);
            Assert.AreEqual("limit", sqlFormatter.LimitClauseAtEnd);
            Assert.AreEqual(sqlFormatter.LeftFieldDelimiter, dbConn.LeftFieldDelimiter);
            Assert.AreEqual(sqlFormatter.RightFieldDelimiter, dbConn.RightFieldDelimiter);
//            StringAssert.Contains(sqlFormatter.LimitClauseAtBeginning, dbConn.GetLimitClauseForBeginning(1));
//            StringAssert.Contains(sqlFormatter.LimitClauseAtEnd, dbConn.GetLimitClauseForEnd(1));
        }
 public void Test_IsolationLevel_PostgreSql()
 {
     //---------------Execute Test ----------------------
     DatabaseConnection conn =
         new DatabaseConnectionPostgreSql("Npgsql", "Npgsql.NpgsqlConnection");
     //---------------Test Result -----------------------
     Assert.AreEqual(IsolationLevel.RepeatableRead, conn.IsolationLevel);
 }
 public void Test_CreateDatabaseConnection_PostgreSql()
 {
     DatabaseConnection conn =
         new DatabaseConnectionPostgreSql("Npgsql", "Npgsql.NpgsqlConnection");
     conn.ConnectionString =
         new DatabaseConfig(DatabaseConfig.PostgreSql, "test", "test", "test", "test", "1000").
             GetConnectionString();
     Assert.AreEqual
         ("Npgsql", conn.TestConnection.GetType().Namespace, "Namespace of PostgreSql connection is wrong.");
 }