public void TestCreateParameterNameGenerator() { //---------------Set up test pack------------------- IDatabaseConnection databaseConnection = new DatabaseConnectionOracle("", ""); //---------------Assert PreConditions--------------- //---------------Execute Test ---------------------- IParameterNameGenerator generator = databaseConnection.CreateParameterNameGenerator(); //---------------Test Result ----------------------- Assert.AreEqual(":", generator.PrefixCharacter); //---------------Tear Down ------------------------- }
public void Test_IsolationLevel_Oracle() { //---------------Execute Test ---------------------- DatabaseConnection conn = new DatabaseConnectionOracle("System.Data.OracleClient", "System.Data.OracleClient.OracleConnection"); //---------------Test Result ----------------------- Assert.AreEqual(IsolationLevel.ReadCommitted, conn.IsolationLevel); }
public void Test_CreateSqlFormatter_AlternateConstructor_Oracle() { //---------------Set up test pack------------------- string connectionString = new DatabaseConfig(DatabaseConfig.SqlServer, "test", "test", "test", "test", "1000").GetConnectionString (); IDatabaseConnection dbConn = new DatabaseConnectionOracle ("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("ROWNUM <=", sqlFormatter.LimitClauseAtEnd); Assert.AreEqual("", dbConn.LeftFieldDelimiter); Assert.AreEqual("", dbConn.RightFieldDelimiter); // StringAssert.Contains(sqlFormatter.LimitClauseAtBeginning, dbConn.GetLimitClauseForBeginning(1)); // StringAssert.Contains(sqlFormatter.LimitClauseAtEnd, dbConn.GetLimitClauseForEnd(1)); }
public void Test_CreateDatabaseConnection_OracleMicrosoft() { DatabaseConnection conn = new DatabaseConnectionOracle ("System.Data.OracleClient, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089", "System.Data.OracleClient.OracleConnection"); conn.ConnectionString = new DatabaseConfig(DatabaseConfig.Oracle, "test", "test", "test", "test", "1000").GetConnectionString(); Assert.AreEqual ("System.Data.OracleClient", conn.TestConnection.GetType().Namespace, "Namespace of Oracle connection is wrong."); }