public void Test_IsolationLevel_SqlServerCe() { //---------------Execute Test ---------------------- DatabaseConnection conn = new DatabaseConnectionSqlServerCe("System.Data.SqlServerCe", "System.Data.SqlServerCe.SqlCeConnection"); //---------------Test Result ----------------------- Assert.AreEqual(IsolationLevel.ReadCommitted, conn.IsolationLevel); }
public void Test_CreateSqlFormatter_AlternateConstructor_SQLServerCe() { //---------------Set up test pack------------------- string connectionString = new DatabaseConfig(DatabaseConfig.SqlServerCe, "test", "test", "test", "test", "1000").GetConnectionString (); IDatabaseConnection dbConn = new DatabaseConnectionSqlServerCe ("System.Data.SqlServerCe", "System.Data.SqlServerCe.SqlCeConnection", connectionString); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- ISqlFormatter defaultSqlFormatter = dbConn.SqlFormatter; //---------------Test Result ----------------------- Assert.IsInstanceOf(typeof(SqlFormatterForSqlServerCe), defaultSqlFormatter); SqlFormatter sqlFormatter = (SqlFormatter)defaultSqlFormatter; Assert.IsNotNull(sqlFormatter); Assert.AreEqual("[", sqlFormatter.LeftFieldDelimiter); Assert.AreEqual("]", sqlFormatter.RightFieldDelimiter); Assert.AreEqual("TOP", sqlFormatter.LimitClauseAtBeginning); Assert.AreEqual("", sqlFormatter.LimitClauseAtEnd); Assert.AreEqual("[", dbConn.LeftFieldDelimiter); Assert.AreEqual("]", dbConn.RightFieldDelimiter); // StringAssert.Contains("TOP", dbConn.GetLimitClauseForBeginning(1)); // Assert.AreEqual("", dbConn.GetLimitClauseForEnd(1)); }
public void Test_CreateDatabaseConnection_SqlServerCe() { DatabaseConnection conn = new DatabaseConnectionSqlServerCe ("System.Data.SqlServerCe", "System.Data.SqlServerCe.SqlCeConnection"); conn.ConnectionString = new DatabaseConfig(DatabaseConfig.SqlServerCe, "test", "test", "test", "test", "1000").GetConnectionString (); Assert.AreEqual ("System.Data.SqlServerCe", conn.TestConnection.GetType().Namespace, "Namespace of Sql connection is wrong."); }