Used to store specific SQL formatting information for an SQL Server Compact Edition database. Typically databases differ in the characters used to differentiate fields and tables e.g. [ and ] for ms sql and ` for MySQL.
Inheritance: Habanero.Base.SqlFormatter
		public void GetLimitClauseCriteriaForBegin_ShouldFormatTopWithBrackets()
		{
			//---------------Set up test pack-------------------
			var sqlFormatter = new SqlFormatterForSqlServerCe("[", "]", "TOP", "");
			int limit = TestUtil.GetRandomInt();
			//---------------Assert Precondition----------------
			Assert.AreEqual("TOP", sqlFormatter.LimitClauseAtBeginning);
			//---------------Execute Test ----------------------
			string limitClauseCriteriaForBegin = sqlFormatter.GetLimitClauseCriteriaForBegin(limit);
			//---------------Test Result -----------------------
			string expected = string.Format("TOP({0})", limit);
			Assert.AreEqual(expected,limitClauseCriteriaForBegin);
		}
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor to initialise the connection object with an
 /// assembly name, class name and connection string
 /// </summary>
 /// <param name="assemblyName">The assembly name</param>
 /// <param name="className">The class name</param>
 /// <param name="connectString">The connection string, which can be
 /// generated using ConnectionStringSqlServerFactory.CreateConnectionString()
 /// </param>
 public DatabaseConnectionSqlServerCe(string assemblyName, string className, string connectString)
     : base(assemblyName, className, connectString)
 {
     _sqlFormatter = new SqlFormatterForSqlServerCe("[", "]", "TOP", "");
 }
        /// <summary>
        /// Constructor to initialise the connection object with an
        /// assembly name, class name and connection string
        /// </summary>
        /// <param name="assemblyName">The assembly name</param>
        /// <param name="className">The class name</param>
        /// <param name="connectString">The connection string, which can be
        /// generated using ConnectionStringSqlServerFactory.CreateConnectionString()
        /// </param>
		public DatabaseConnectionSqlServerCe(string assemblyName, string className, string connectString)
            : base(assemblyName, className, connectString)
		{
			_sqlFormatter = new SqlFormatterForSqlServerCe("[", "]", "TOP", "");
        }