ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gba...@apache.org
Subject svn commit: r464983 [1/3] - in /ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests: BaseTest.cs DynamicPrependTest.cs DynamicTest.cs Generics/StatementTest.cs ResultMapTest.cs StatementTest.cs
Date Tue, 17 Oct 2006 18:05:39 GMT
Author: gbayon
Date: Tue Oct 17 11:05:38 2006
New Revision: 464983

URL: http://svn.apache.org/viewvc?view=rev&rev=464983
Log:
Cleaning tests

Modified:
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/DynamicPrependTest.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/DynamicTest.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/StatementTest.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/ResultMapTest.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/StatementTest.cs

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs?view=diff&rev=464983&r1=464982&r2=464983
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs Tue Oct 17 11:05:38 2006
@@ -17,35 +17,35 @@
 using System.Collections.Specialized;
 
 
-[assembly : log4net.Config.XmlConfigurator(Watch=true)]
+[assembly: log4net.Config.XmlConfigurator(Watch = true)]
 
 namespace IBatisNet.DataMapper.Test.NUnit.SqlMapTests
 {
-	public delegate string KeyConvert(string key);
+    public delegate string KeyConvert(string key);
 
-	/// <summary>
-	/// Summary description for BaseTest.
-	/// </summary>
-	[TestFixture] 
-	public abstract class BaseTest
-	{
-		/// <summary>
-		/// The sqlMap
-		/// </summary>
-		protected static ISqlMapper sqlMap = null;
-		private static readonly ILog _logger = LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod().DeclaringType );
-
-		protected static string ScriptDirectory = null;
-
-		protected static KeyConvert ConvertKey = null;
-
-		/// <summary>
-		/// Constructor
-		/// </summary>
-		static BaseTest()
-		{
+    /// <summary>
+    /// Summary description for BaseTest.
+    /// </summary>
+    [TestFixture]
+    public abstract class BaseTest
+    {
+        /// <summary>
+        /// The sqlMap
+        /// </summary>
+        protected static ISqlMapper sqlMap = null;
+        private static readonly ILog _logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
+        protected static string ScriptDirectory = null;
+
+        protected static KeyConvert ConvertKey = null;
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        static BaseTest()
+        {
 #if dotnet2
-			ScriptDirectory = Path.Combine(Path.Combine(Path.Combine(Path.Combine(Resources.ApplicationBase, ".."), ".."), "Scripts"),
+            ScriptDirectory = Path.Combine(Path.Combine(Path.Combine(Path.Combine(Resources.ApplicationBase, ".."), ".."), "Scripts"),
                 ConfigurationManager.AppSettings["database"]) + Path.DirectorySeparatorChar;
 #else
             ScriptDirectory = Path.Combine(Path.Combine(Path.Combine(Path.Combine(Resources.ApplicationBase, ".."), ".."), "Scripts"), 
@@ -53,18 +53,18 @@
 #endif
         }
 
-		/// <summary>
-		/// Initialize an sqlMap
-		/// </summary>
-		[TestFixtureSetUp]
-		protected virtual void SetUpFixture()
-		{
-			//DateTime start = DateTime.Now;
+        /// <summary>
+        /// Initialize an sqlMap
+        /// </summary>
+        [TestFixtureSetUp]
+        protected virtual void SetUpFixture()
+        {
+            //DateTime start = DateTime.Now;
 
-			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+            DomSqlMapBuilder builder = new DomSqlMapBuilder();
 #if dotnet2
             NameValueCollection properties = new NameValueCollection();
-            properties.Add("collection2Namespace","IBatisNet.DataMapper.Test.Domain.LineItemCollection2, IBatisNet.DataMapper.Test");
+            properties.Add("collection2Namespace", "IBatisNet.DataMapper.Test.Domain.LineItemCollection2, IBatisNet.DataMapper.Test");
             properties.Add("nullableInt", "int?");
             builder.Properties = properties;
 
@@ -81,7 +81,7 @@
             {
                 sqlMap = builder.Configure(fileName);
             }
-            catch(Exception ex)
+            catch (Exception ex)
             {
                 Exception e = ex;
                 while (e != null)
@@ -89,197 +89,209 @@
                     Console.WriteLine(e.Message);
                     Console.WriteLine(e.StackTrace.ToString());
                     e = e.InnerException;
-                    
+
                 }
-				throw;
+                throw;
+            }
+
+            if (sqlMap.DataSource.DbProvider.Name.IndexOf("PostgreSql") >= 0)
+            {
+                BaseTest.ConvertKey = new KeyConvert(Lower);
+            }
+            else if (sqlMap.DataSource.DbProvider.Name.IndexOf("oracle") >= 0)
+            {
+                BaseTest.ConvertKey = new KeyConvert(Upper);
+            }
+            else
+            {
+                BaseTest.ConvertKey = new KeyConvert(Normal);
             }
 
-			if ( sqlMap.DataSource.DbProvider.Name.IndexOf("PostgreSql")>=0)
-			{
-				BaseTest.ConvertKey = new KeyConvert(Lower);
-			}
-			else if ( sqlMap.DataSource.DbProvider.Name.IndexOf("oracle")>=0)
-			{
-				BaseTest.ConvertKey = new KeyConvert(Upper);
-			}
-			else 
-			{
-				BaseTest.ConvertKey = new KeyConvert(Normal);
-			}
-
-//			string loadTime = DateTime.Now.Subtract(start).ToString();
-//			Console.WriteLine("Loading configuration time :"+loadTime);
-		}
-
-		/// <summary>
-		/// Dispose the SqlMap
-		/// </summary>
-		[TestFixtureTearDown]
-		protected virtual void TearDownFixture()
-		{
-			sqlMap = null;
-		}
-
-//		[SetUp]
-//		public virtual void SetUp()
-//		{
-//		}
-//
-//		[TearDown]
-//		public virtual void TearDown()
-//		{
-//		}
-
-		protected static string Normal(string key)
-		{
-			return key;
-		}
-
-		protected static string Upper(string key)
-		{
-			return key.ToUpper();
-		}
-
-		protected static string Lower(string key)
-		{
-			return key.ToLower();
-		}
-
-		/// <summary>
-		/// Configure the SqlMap
-		/// </summary>
-		/// <remarks>
-		/// Must verify ConfigureHandler signature.
-		/// </remarks>
-		/// <param name="obj">
-		/// The reconfigured sqlMap.
-		/// </param>
-		protected static void Configure(object obj)
-		{
-			sqlMap = null;//(SqlMapper) obj;
-		}
-
-		/// <summary>
-		/// Run a sql batch for the datasource.
-		/// </summary>
-		/// <param name="datasource">The datasource.</param>
-		/// <param name="script">The sql batch</param>
-		protected static void InitScript(IDataSource datasource, string script)
-		{
-			InitScript(datasource, script, true);
-		}
-
-		/// <summary>
-		/// Run a sql batch for the datasource.
-		/// </summary>
-		/// <param name="datasource">The datasource.</param>
-		/// <param name="script">The sql batch</param>
-		/// <param name="doParse">parse out the statements in the sql script file.</param>
+            //			string loadTime = DateTime.Now.Subtract(start).ToString();
+            //			Console.WriteLine("Loading configuration time :"+loadTime);
+        }
+
+        /// <summary>
+        /// Dispose the SqlMap
+        /// </summary>
+        [TestFixtureTearDown]
+        protected virtual void TearDownFixture()
+        {
+            sqlMap = null;
+        }
+
+        //		[SetUp]
+        //		public virtual void SetUp()
+        //		{
+        //		}
+        //
+        //		[TearDown]
+        //		public virtual void TearDown()
+        //		{
+        //		}
+
+        protected static string Normal(string key)
+        {
+            return key;
+        }
+
+        protected static string Upper(string key)
+        {
+            return key.ToUpper();
+        }
+
+        protected static string Lower(string key)
+        {
+            return key.ToLower();
+        }
+
+        /// <summary>
+        /// Configure the SqlMap
+        /// </summary>
+        /// <remarks>
+        /// Must verify ConfigureHandler signature.
+        /// </remarks>
+        /// <param name="obj">
+        /// The reconfigured sqlMap.
+        /// </param>
+        protected static void Configure(object obj)
+        {
+            sqlMap = null;//(SqlMapper) obj;
+        }
+
+        /// <summary>
+        /// Run a sql batch for the datasource.
+        /// </summary>
+        /// <param name="datasource">The datasource.</param>
+        /// <param name="script">The sql batch</param>
+        protected static void InitScript(IDataSource datasource, string script)
+        {
+            InitScript(datasource, script, true);
+        }
+
+        /// <summary>
+        /// Run a sql batch for the datasource.
+        /// </summary>
+        /// <param name="datasource">The datasource.</param>
+        /// <param name="script">The sql batch</param>
+        /// <param name="doParse">parse out the statements in the sql script file.</param>
         protected static void InitScript(IDataSource datasource, string script, bool doParse)
-		{
-			ScriptRunner runner = new ScriptRunner();
+        {
+            ScriptRunner runner = new ScriptRunner();
+
+            runner.RunScript(datasource, script, doParse);
+        }
 
-			runner.RunScript(datasource, script, doParse);
-		}
+        /// <summary>
+        /// Create a new account with id = 6
+        /// </summary>
+        /// <returns>An account</returns>
+        protected Account NewAccount6()
+        {
+            Account account = new Account();
+            account.Id = 6;
+            account.FirstName = "Calamity";
+            account.LastName = "Jane";
+            account.EmailAddress = "no_email@provided.com";
+            return account;
+        }
+
+        /// <summary>
+        /// Verify that the input account is equal to the account(id=1).
+        /// </summary>
+        /// <param name="account">An account object</param>
+        protected void AssertGilles(Account account)
+        {
+            Assert.AreEqual(5, account.Id, "account.Id");
+            Assert.AreEqual("Gilles", account.FirstName, "account.FirstName");
+            Assert.AreEqual("Bayon", account.LastName, "account.LastName");
+            Assert.AreEqual("gilles.bayon@nospam.org", account.EmailAddress, "account.EmailAddress");
+        }
+
+        /// <summary>
+        /// Verify that the input account is equal to the account(id=1).
+        /// </summary>
+        /// <param name="account">An account object</param>
+        protected void AssertAccount1(Account account)
+        {
+            Assert.AreEqual(1, account.Id, "account.Id");
+            Assert.AreEqual("Joe", account.FirstName, "account.FirstName");
+            Assert.AreEqual("Dalton", account.LastName, "account.LastName");
+            Assert.AreEqual("Joe.Dalton@somewhere.com", account.EmailAddress, "account.EmailAddress");
+        }
 
-		/// <summary>
-		/// Create a new account with id = 6
-		/// </summary>
-		/// <returns>An account</returns>
-		protected Account NewAccount6()
-		{
-			Account account = new Account();
-			account.Id = 6;
-			account.FirstName = "Calamity";
-			account.LastName = "Jane";
-			account.EmailAddress = "no_email@provided.com";
-			return account;
-		}
-
-		/// <summary>
-		/// Verify that the input account is equal to the account(id=1).
-		/// </summary>
-		/// <param name="account">An account object</param>
-		protected void AssertAccount1(Account account)
-		{
-			Assert.AreEqual(1, account.Id, "account.Id");
-			Assert.AreEqual("Joe", account.FirstName, "account.FirstName");
-			Assert.AreEqual("Dalton", account.LastName, "account.LastName");
-			Assert.AreEqual("Joe.Dalton@somewhere.com", account.EmailAddress, "account.EmailAddress");
-		}
-
-		/// <summary>
-		/// Verify that the input account is equal to the account(id=1).
-		/// </summary>
-		/// <param name="account">An account as hashtable</param>
-		protected void AssertAccount1AsHashtable(Hashtable account)
-		{
-			Assert.AreEqual(1, (int) account["Id"], "account.Id");
-			Assert.AreEqual("Joe", (string) account["FirstName"], "account.FirstName");
-			Assert.AreEqual("Dalton", (string) account["LastName"], "account.LastName");
-			Assert.AreEqual("Joe.Dalton@somewhere.com", (string) account["EmailAddress"], "account.EmailAddress");
-		}
-
-		/// <summary>
-		/// Verify that the input account is equal to the account(id=1).
-		/// </summary>
-		/// <param name="account">An account as hashtable</param>
-		protected void AssertAccount1AsHashtableForResultClass(Hashtable account)
-		{
-			Assert.AreEqual(1, (int) account[BaseTest.ConvertKey("Id")], "account.Id");
-			Assert.AreEqual("Joe", (string) account[BaseTest.ConvertKey("FirstName")], "account.FirstName");
-			Assert.AreEqual("Dalton", (string) account[BaseTest.ConvertKey("LastName")], "account.LastName");
-			Assert.AreEqual("Joe.Dalton@somewhere.com", (string) account[BaseTest.ConvertKey("EmailAddress")], "account.EmailAddress");
-		}
-
-		/// <summary>
-		/// Verify that the input account is equal to the account(id=6).
-		/// </summary>
-		/// <param name="account">An account object</param>
-		protected void AssertAccount6(Account account)
-		{
-			Assert.AreEqual(6, account.Id, "account.Id");
-			Assert.AreEqual("Calamity", account.FirstName, "account.FirstName");
-			Assert.AreEqual("Jane", account.LastName, "account.LastName");
-			Assert.IsNull(account.EmailAddress, "account.EmailAddress");
-		}
-
-		/// <summary>
-		/// Verify that the input order is equal to the order(id=1).
-		/// </summary>
-		/// <param name="order">An order object.</param>
-		protected void AssertOrder1(Order order)
-		{
-			DateTime date = new DateTime(2003, 2, 15, 8, 15, 00);
-
-			Assert.AreEqual(1, order.Id, "order.Id");
-			Assert.AreEqual(date.ToString(), order.Date.ToString(), "order.Date");
-			Assert.AreEqual("VISA", order.CardType, "order.CardType");
-			Assert.AreEqual("999999999999", order.CardNumber, "order.CardNumber");
-			Assert.AreEqual("05/03", order.CardExpiry, "order.CardExpiry");
-			Assert.AreEqual("11 This Street", order.Street, "order.Street");
-			Assert.AreEqual("Victoria", order.City, "order.City");
-			Assert.AreEqual("BC", order.Province, "order.Id");
-			Assert.AreEqual("C4B 4F4", order.PostalCode, "order.PostalCode");
-		}
-
-		/// <summary>
-		/// Verify that the input order is equal to the order(id=1).
-		/// </summary>
-		/// <param name="order">An order as hashtable.</param>
-		protected void AssertOrder1AsHashtable(Hashtable order)
-		{
-			DateTime date = new DateTime(2003, 2, 15, 8, 15, 00);
-
-			Assert.AreEqual(1, (int) order["Id"], "order.Id");
-			Assert.AreEqual(date.ToString(), ((DateTime) order["Date"]).ToString(), "order.Date");
-			Assert.AreEqual("VISA", (string) order["CardType"], "order.CardType");
-			Assert.AreEqual("999999999999", (string) order["CardNumber"], "order.CardNumber");
-			Assert.AreEqual("05/03", (string) order["CardExpiry"], "order.CardExpiry");
-			Assert.AreEqual("11 This Street", (string) order["Street"], "order.Street");
-			Assert.AreEqual("Victoria", (string) order["City"], "order.City");
-			Assert.AreEqual("BC", (string) order["Province"], "order.Id");
-			Assert.AreEqual("C4B 4F4", (string) order["PostalCode"], "order.PostalCode");
-		}
-	}
+        /// <summary>
+        /// Verify that the input account is equal to the account(id=1).
+        /// </summary>
+        /// <param name="account">An account as hashtable</param>
+        protected void AssertAccount1AsHashtable(Hashtable account)
+        {
+            Assert.AreEqual(1, (int)account["Id"], "account.Id");
+            Assert.AreEqual("Joe", (string)account["FirstName"], "account.FirstName");
+            Assert.AreEqual("Dalton", (string)account["LastName"], "account.LastName");
+            Assert.AreEqual("Joe.Dalton@somewhere.com", (string)account["EmailAddress"], "account.EmailAddress");
+        }
+
+        /// <summary>
+        /// Verify that the input account is equal to the account(id=1).
+        /// </summary>
+        /// <param name="account">An account as hashtable</param>
+        protected void AssertAccount1AsHashtableForResultClass(Hashtable account)
+        {
+            Assert.AreEqual(1, (int)account[BaseTest.ConvertKey("Id")], "account.Id");
+            Assert.AreEqual("Joe", (string)account[BaseTest.ConvertKey("FirstName")], "account.FirstName");
+            Assert.AreEqual("Dalton", (string)account[BaseTest.ConvertKey("LastName")], "account.LastName");
+            Assert.AreEqual("Joe.Dalton@somewhere.com", (string)account[BaseTest.ConvertKey("EmailAddress")], "account.EmailAddress");
+        }
+
+        /// <summary>
+        /// Verify that the input account is equal to the account(id=6).
+        /// </summary>
+        /// <param name="account">An account object</param>
+        protected void AssertAccount6(Account account)
+        {
+            Assert.AreEqual(6, account.Id, "account.Id");
+            Assert.AreEqual("Calamity", account.FirstName, "account.FirstName");
+            Assert.AreEqual("Jane", account.LastName, "account.LastName");
+            Assert.IsNull(account.EmailAddress, "account.EmailAddress");
+        }
+
+        /// <summary>
+        /// Verify that the input order is equal to the order(id=1).
+        /// </summary>
+        /// <param name="order">An order object.</param>
+        protected void AssertOrder1(Order order)
+        {
+            DateTime date = new DateTime(2003, 2, 15, 8, 15, 00);
+
+            Assert.AreEqual(1, order.Id, "order.Id");
+            Assert.AreEqual(date.ToString(), order.Date.ToString(), "order.Date");
+            Assert.AreEqual("VISA", order.CardType, "order.CardType");
+            Assert.AreEqual("999999999999", order.CardNumber, "order.CardNumber");
+            Assert.AreEqual("05/03", order.CardExpiry, "order.CardExpiry");
+            Assert.AreEqual("11 This Street", order.Street, "order.Street");
+            Assert.AreEqual("Victoria", order.City, "order.City");
+            Assert.AreEqual("BC", order.Province, "order.Id");
+            Assert.AreEqual("C4B 4F4", order.PostalCode, "order.PostalCode");
+        }
+
+        /// <summary>
+        /// Verify that the input order is equal to the order(id=1).
+        /// </summary>
+        /// <param name="order">An order as hashtable.</param>
+        protected void AssertOrder1AsHashtable(Hashtable order)
+        {
+            DateTime date = new DateTime(2003, 2, 15, 8, 15, 00);
+
+            Assert.AreEqual(1, (int)order["Id"], "order.Id");
+            Assert.AreEqual(date.ToString(), ((DateTime)order["Date"]).ToString(), "order.Date");
+            Assert.AreEqual("VISA", (string)order["CardType"], "order.CardType");
+            Assert.AreEqual("999999999999", (string)order["CardNumber"], "order.CardNumber");
+            Assert.AreEqual("05/03", (string)order["CardExpiry"], "order.CardExpiry");
+            Assert.AreEqual("11 This Street", (string)order["Street"], "order.Street");
+            Assert.AreEqual("Victoria", (string)order["City"], "order.City");
+            Assert.AreEqual("BC", (string)order["Province"], "order.Id");
+            Assert.AreEqual("C4B 4F4", (string)order["PostalCode"], "order.PostalCode");
+        }
+    }
 }

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/DynamicPrependTest.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/DynamicPrependTest.cs?view=diff&rev=464983&r1=464982&r2=464983
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/DynamicPrependTest.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/DynamicPrependTest.cs Tue Oct 17 11:05:38 2006
@@ -11,464 +11,464 @@
 
 namespace IBatisNet.DataMapper.Test.NUnit.SqlMapTests
 {
-	/// <summary>
-	/// Summary description for DynamicPrependTest.
-	/// </summary>
-	[TestFixture] 
-	public class DynamicPrependTest : BaseTest
-	{
-		#region SetUp & TearDown
-
-		/// <summary>
-		/// SetUp
-		/// </summary>
-		[SetUp] 
-		public void Init() 
-		{
-			InitScript( sqlMap.DataSource, ScriptDirectory + "account-init.sql" );
-			InitScript( sqlMap.DataSource, ScriptDirectory + "account-procedure.sql", false );
-			InitScript( sqlMap.DataSource, ScriptDirectory + "category-init.sql" );
-			InitScript( sqlMap.DataSource, ScriptDirectory + "order-init.sql" );
-			InitScript( sqlMap.DataSource, ScriptDirectory + "line-item-init.sql" );
-			InitScript( sqlMap.DataSource, ScriptDirectory + "other-init.sql" );
-		}
-
-		/// <summary>
-		/// TearDown
-		/// </summary>
-		[TearDown] 
-		public void Dispose()
-		{ /* ... */ } 
-
-		#endregion
-
-		#region Dynamic Prepend tests
-
-		/// <summary>
-		/// Test Dynamic With Prepend (1)
-		/// </summary>
-		[Test] 
-		public void TestDynamicJIRA168()  
-		{
-			Query query = new Query();
-			Account account = new Account();
-			account.Id = 1;
-			query.DataObject = account;
-
-			account = (Account) sqlMap.QueryForObject("DynamicJIRA168", query);
-
-			AssertAccount1(account);
-		}
-		
-		/// <summary>
-		/// Test Iterate With Prepend (1)
-		/// </summary>
-		[Test] 
-		public void TestIterateWithPrepend1()  
-		{
-			IList parameters = new ArrayList();
-			parameters.Add(1);
-			parameters.Add(2);
-			parameters.Add(3);
-			
-			IList list = sqlMap.QueryForList("DynamicIterateWithPrepend1", parameters);
-
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(3, list.Count);
-		}
-
-		/// <summary>
-		/// Test Iterate With Prepend (2)
-		/// </summary>
-		[Test] 
-		public void TestIterateWithPrepend2()  
-		{
-			IList parameters = new ArrayList();
-			parameters.Add(1);
-			parameters.Add(2);
-			parameters.Add(3);
-			
-			IList list = sqlMap.QueryForList("DynamicIterateWithPrepend2", parameters);
-
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(3, list.Count);
-		}
-
-		/// <summary>
-		/// Test Iterate With Prepend (3)
-		/// </summary>
-		[Test] 
-		public void TestIterateWithPrepend3()  
-		{
-			IList parameters = new ArrayList();
-			parameters.Add(1);
-			parameters.Add(2);
-			parameters.Add(3);
-			
-			IList list = sqlMap.QueryForList("DynamicIterateWithPrepend3", parameters);
-			
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(3, list.Count);
-		}
-
-		/// <summary>
-		/// Test Dynamic With Prepend (1)
-		/// </summary>
-		[Test] 
-		public void TestDynamicWithPrepend1()  
-		{
-			Account account = new Account();
-			account.Id = 1;
-
-			account = (Account) sqlMap.QueryForObject("DynamicWithPrepend", account);
-
-			AssertAccount1(account);
-		}
-
-		/// <summary>
-		/// Test Dynamic With Prepend (2)
-		/// </summary>
-		[Test] 
-		public void TestDynamicWithPrepend2()  
-		{
-			Account account = new Account();
-			account.Id = 1;
-			account.FirstName = "Joe";
-
-			account = (Account) sqlMap.QueryForObject("DynamicWithPrepend", account);
-			AssertAccount1(account);
-
-		}
-
-		/// <summary>
-		/// Test Dynamic With Prepend (3)
-		/// </summary>
-		[Test] 
-		public void TestDynamicWithPrepend3()  
-		{
-			Account account = new Account();
-			account.Id = 1;
-			account.FirstName = "Joe";
-			account.LastName = "Dalton";
-
-			account = (Account) sqlMap.QueryForObject("DynamicWithPrepend", account);
-			AssertAccount1(account);
-		}
-
-		/// <summary>
-		/// Test Dynamic With Prepend (4)
-		/// </summary>
-		[Test] 
-		public void TestDynamicWithPrepend4()  
-		{
-			IList list = sqlMap.QueryForList("DynamicWithPrepend", null);
-
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test Iterate With Two Prepends
-		/// </summary>
-		[Test] 
-		public void TestIterateWithTwoPrepends() 
-		{
-			Account account = new Account();
-			account.Id = 1;
-			account.FirstName = "Joe";
-
-			account = sqlMap.QueryForObject("DynamicWithPrepend", account) as Account;
-			Assert.IsNotNull(account);
-			AssertAccount1(account);
-
-			IList list = sqlMap.QueryForList("DynamicWithTwoDynamicElements", account);
-			AssertAccount1((Account) list[0]);
-		}
-
-		/// <summary>
-		/// Test Complex Dynamic
-		/// </summary>
-		[Test] 
-		public void TestComplexDynamic() 
-		{
-			Account account = new Account();
-			account.Id = 1;
-			account.FirstName = "Joe";
-			account.LastName = "Dalton";
-			
-			IList list = sqlMap.QueryForList("ComplexDynamicStatement", account);
-
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(1, list.Count);
-		}
-
-		/// <summary>
-		/// Test GetAccounts Dynamic
-		/// </summary>
-		/// <remarks>
-		/// Bug Fix http://sourceforge.net/forum/message.php?msg_id=2646964
-		/// </remarks>
-		[Test] 
-		public void TestGetAccountsDynamic() 
-		{
-			Hashtable map = new Hashtable();
-			map.Add("MaximumAllowed",100);
-
-			map.Add("FirstName","Joe");
-			map.Add("LastName","Dalton");
-			map.Add("EmailAddress","Joe.Dalton@somewhere.com");
-
-			IList list = sqlMap.QueryForList("GetAccountsDynamic", map);
-
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(1, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsEqual with HashTable
-		/// </summary>
-		/// <remarks>
-		/// Bug Fix https://sourceforge.net/forum/message.php?msg_id=2840259
-		/// </remarks>
-		[Test] 
-		public void TestDynamicSelectByIntLong() 
-		{
-			Hashtable search = new Hashtable(); 
-			search.Add("year", 0); 
-			search.Add("areaid", 0); 
-
-			IList list = sqlMap.QueryForList("DynamicSelectByIntLong", search);
-
-			Assert.AreEqual(2, list.Count);
-			Assert.AreEqual(1, (list[0] as Other).Int);
-			Assert.AreEqual(8888888, (list[0] as Other).Long);
-			Assert.AreEqual(false, (list[0] as Other).Bool);
-
-			Assert.AreEqual(2, (list[1] as Other).Int);
-			Assert.AreEqual(9999999999, (list[1] as Other).Long);
-			Assert.AreEqual(true, (list[1] as Other).Bool);
-
-			//----------------------
-			search.Clear();
-			search.Add("year", 1); 
-			search.Add("areaid", 0); 
-
-			list= null;
-			list = sqlMap.QueryForList("DynamicSelectByIntLong", search);
-
-			Assert.AreEqual(1, list.Count);
-			//----------------------
-			search.Clear();
-			search.Add("year", 0); 
-			search.Add("areaid", 9999999999); 
-
-			list= null;
-			list = sqlMap.QueryForList("DynamicSelectByIntLong", search);
-
-			Assert.AreEqual(1, list.Count);
-			Assert.AreEqual(2, (list[0] as Other).Int);
-			//----------------------
-			search.Clear();
-			search.Add("year", 2); 
-			search.Add("areaid", 9999999999); 
-
-			list= null;
-			list = sqlMap.QueryForList("DynamicSelectByIntLong", search);
-
-			Assert.AreEqual(1, list.Count);
-			Assert.AreEqual(2, (list[0] as Other).Int);
-			Assert.AreEqual(9999999999, (list[0] as Other).Long);
-			Assert.AreEqual(true, (list[0] as Other).Bool);
-		}
-
-		/// <summary>
-		/// Test Dynamic With GUID
-		/// </summary>
-		[Test] 
-		public void TestDynamicWithGUID() 
-		{
-			Category category = new Category();
-			category.Name = "toto";
-			category.Guid = Guid.Empty;
-
-			int key = (int)sqlMap.Insert("InsertCategory", category);
-
-			category = new Category();
-			category.Name = "titi";
-			category.Guid = Guid.NewGuid();
-
-			Category categoryTest = (Category)sqlMap.QueryForObject("DynamicGuid", category);
-			Assert.IsNull(categoryTest);
-
-			category = new Category();
-			category.Name = "titi";
-			category.Guid = Guid.Empty;
-
-			categoryTest = (Category)sqlMap.QueryForObject("DynamicGuid", category);
-			Assert.IsNotNull(categoryTest);
-		}
-
-		/// <summary>
-		/// Test JIRA 11
-		/// </summary>
-		/// <remarks>
-		/// To test only for MSSQL with .NET SqlClient provider
-		/// </remarks>
-		[Test] 
-		[Category("MSSQL")]
-		public void TestJIRA11() 
-		{
-			Search search = new Search();
-			search.NumberSearch = 123;
-			search.StartDate = new DateTime(2004,12,25);
-			search.Operande = "like";
-			search.StartDateAnd = true;
-			
-			CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
-			Thread.CurrentThread.CurrentCulture =  new CultureInfo("fr-FR");
-
-			IList list = sqlMap.QueryForList("Jira-IBATISNET-11", search);
-
-			Thread.CurrentThread.CurrentCulture = currentCulture;
-
-			Assert.AreEqual(0, list.Count);
-		}
-
-		/// <summary>
-		/// We've been using the stable version of Ibatis for a while and recently
-		/// upgraded to the latest alpha version 1.1.0.458. The old version was
-		/// able to handle mapping the .Net bool type to SqlServer's Bit column.
-		/// When we run sql maps that contain a bool property, we now get an
-		/// exception.
-		/// </summary>
-		/// <remarks>
-		/// No problems !!
-		/// </remarks>
-		[Test] 
-		public void TestDynamicSelectByBool() 
-		{
-			Other other = new Other();
-			other.Bool = true;
-
-			Other anOther = sqlMap.QueryForObject("DynamicSelectByBool", other) as Other;
-
-			Assert.IsNotNull( anOther );
-			Assert.AreEqual(2, anOther.Int);
-			Assert.AreEqual(9999999999, anOther.Long);
-			Assert.AreEqual(true, anOther.Bool);
-
-			other.Bool = false;
-			anOther = sqlMap.QueryForObject("DynamicSelectByBool", other) as Other;
-
-			Assert.IsNotNull( anOther );
-			Assert.AreEqual(1, anOther.Int);
-			Assert.AreEqual(8888888, anOther.Long);
-			Assert.AreEqual(false, anOther.Bool);
-
-		}
-
-		/// <summary>
-		/// Test JIRA 29
-		/// </summary>
-		[Test] 
-		[Category("MSSQL")]
-		public void TestJIRA29() 
-		{
-			Hashtable param = new Hashtable();
-			param["Foo"] = new DateTime(2003, 2, 15, 8, 15, 0); 
-
-			Order order = sqlMap.QueryForObject("SelectOrderByDate", param) as Order;
-
-			Assert.IsNotNull(order);
-
-			Assert.AreEqual(1, order.Id);
-
-			CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
-			Thread.CurrentThread.CurrentCulture =  new CultureInfo("en-US");
-
-			order = sqlMap.QueryForObject("SelectOrderByDateDynamic", param) as Order;
-
-			Thread.CurrentThread.CurrentCulture = currentCulture;
-
-			Assert.IsNotNull(order);
-
-			Assert.AreEqual(1, order.Id);
-		}
-
-		/// <summary>
-		/// Test JIRA 29
-		/// </summary>
-		[Test] 
-		public void Test2ForJIRA29() 
-		{
-			// init
-			Account account = new Account();
-
-			account.Id = 1234;
-			account.FirstName = "#The Pound Signs#";
-			account.LastName = "Gilles";
-			account.EmailAddress = "a.a@somewhere.com";
-
-			sqlMap.Insert("InsertAccountViaInlineParameters", account);
-
-			// test
-			Hashtable param = new Hashtable();
-			param["AccountName"] = "The Pound Signs";
-
-			Account testAccount = sqlMap.QueryForObject("SelectAccountJIRA29", param) as Account;
-
-			Assert.IsNotNull(testAccount);
-			Assert.AreEqual(1234, testAccount.Id);
-			Assert.AreEqual("#The Pound Signs#", testAccount.FirstName);
-		}
-
-		/// <summary>
-		/// Test JIRA 29
-		/// </summary>
-		[Test] 
-		public void Test3ForJIRA29() 
-		{
-			// init
-			Account account = new Account();
-
-			account.Id = 1234;
-			account.FirstName = "#The Pound Signs#";
-			account.LastName = "Gilles";
-			account.EmailAddress = "a.a@somewhere.com";
-
-			sqlMap.Insert("InsertAccountViaInlineParameters", account);
-
-			// test
-			Hashtable param = new Hashtable();
-			param["Foo"] = "The Pound Signs"; 
-
-			Account testAccount = sqlMap.QueryForObject("SelectAccountJIRA29-2", param) as Account;
-
-			Assert.IsNotNull(testAccount);
-			Assert.AreEqual(1234, testAccount.Id);
-			Assert.AreEqual("#The Pound Signs#", testAccount.FirstName);
-		}
-
-		[Test]
-		public void TestSelectKeyWithDynamicSql()
-		{
-			Account account = new Account();
-			account.Id = 99998;
-			account.FirstName = "R";
-			account.LastName = "G";
-
-			Hashtable param = new Hashtable(2);
-			param["Account"] = account;
-			param["AccountsTableName"] = "Accounts";
-			object selectKeyValue = sqlMap.Insert("SelectKeyWithDynamicSql", param);
-
-			Assert.IsNotNull(selectKeyValue);
-			Assert.AreEqual(99998, Convert.ToInt32(selectKeyValue));
-
-			Assert.IsTrue(param.ContainsKey("AccountId"));
-			Assert.AreEqual(99998, (int)param["AccountId"]);
-		}
-		#endregion
+    /// <summary>
+    /// Summary description for DynamicPrependTest.
+    /// </summary>
+    [TestFixture]
+    public class DynamicPrependTest : BaseTest
+    {
+        #region SetUp & TearDown
+
+        /// <summary>
+        /// SetUp
+        /// </summary>
+        [SetUp]
+        public void Init()
+        {
+            InitScript(sqlMap.DataSource, ScriptDirectory + "account-init.sql");
+            InitScript(sqlMap.DataSource, ScriptDirectory + "account-procedure.sql", false);
+            InitScript(sqlMap.DataSource, ScriptDirectory + "category-init.sql");
+            InitScript(sqlMap.DataSource, ScriptDirectory + "order-init.sql");
+            InitScript(sqlMap.DataSource, ScriptDirectory + "line-item-init.sql");
+            InitScript(sqlMap.DataSource, ScriptDirectory + "other-init.sql");
+        }
+
+        /// <summary>
+        /// TearDown
+        /// </summary>
+        [TearDown]
+        public void Dispose()
+        { /* ... */ }
+
+        #endregion
+
+        #region Dynamic Prepend tests
+
+        /// <summary>
+        /// Test Dynamic With Prepend (1)
+        /// </summary>
+        [Test]
+        public void TestDynamicJIRA168()
+        {
+            Query query = new Query();
+            Account account = new Account();
+            account.Id = 1;
+            query.DataObject = account;
+
+            account = (Account)sqlMap.QueryForObject("DynamicJIRA168", query);
+
+            AssertAccount1(account);
+        }
+
+        /// <summary>
+        /// Test Iterate With Prepend (1)
+        /// </summary>
+        [Test]
+        public void TestIterateWithPrepend1()
+        {
+            IList parameters = new ArrayList();
+            parameters.Add(1);
+            parameters.Add(2);
+            parameters.Add(3);
+
+            IList list = sqlMap.QueryForList("DynamicIterateWithPrepend1", parameters);
+
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(3, list.Count);
+        }
+
+        /// <summary>
+        /// Test Iterate With Prepend (2)
+        /// </summary>
+        [Test]
+        public void TestIterateWithPrepend2()
+        {
+            IList parameters = new ArrayList();
+            parameters.Add(1);
+            parameters.Add(2);
+            parameters.Add(3);
+
+            IList list = sqlMap.QueryForList("DynamicIterateWithPrepend2", parameters);
+
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(3, list.Count);
+        }
+
+        /// <summary>
+        /// Test Iterate With Prepend (3)
+        /// </summary>
+        [Test]
+        public void TestIterateWithPrepend3()
+        {
+            IList parameters = new ArrayList();
+            parameters.Add(1);
+            parameters.Add(2);
+            parameters.Add(3);
+
+            IList list = sqlMap.QueryForList("DynamicIterateWithPrepend3", parameters);
+
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(3, list.Count);
+        }
+
+        /// <summary>
+        /// Test Dynamic With Prepend (1)
+        /// </summary>
+        [Test]
+        public void TestDynamicWithPrepend1()
+        {
+            Account account = new Account();
+            account.Id = 1;
+
+            account = (Account)sqlMap.QueryForObject("DynamicWithPrepend", account);
+
+            AssertAccount1(account);
+        }
+
+        /// <summary>
+        /// Test Dynamic With Prepend (2)
+        /// </summary>
+        [Test]
+        public void TestDynamicWithPrepend2()
+        {
+            Account account = new Account();
+            account.Id = 1;
+            account.FirstName = "Joe";
+
+            account = (Account)sqlMap.QueryForObject("DynamicWithPrepend", account);
+            AssertAccount1(account);
+
+        }
+
+        /// <summary>
+        /// Test Dynamic With Prepend (3)
+        /// </summary>
+        [Test]
+        public void TestDynamicWithPrepend3()
+        {
+            Account account = new Account();
+            account.Id = 1;
+            account.FirstName = "Joe";
+            account.LastName = "Dalton";
+
+            account = (Account)sqlMap.QueryForObject("DynamicWithPrepend", account);
+            AssertAccount1(account);
+        }
+
+        /// <summary>
+        /// Test Dynamic With Prepend (4)
+        /// </summary>
+        [Test]
+        public void TestDynamicWithPrepend4()
+        {
+            IList list = sqlMap.QueryForList("DynamicWithPrepend", null);
+
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test Iterate With Two Prepends
+        /// </summary>
+        [Test]
+        public void TestIterateWithTwoPrepends()
+        {
+            Account account = new Account();
+            account.Id = 1;
+            account.FirstName = "Joe";
+
+            account = sqlMap.QueryForObject("DynamicWithPrepend", account) as Account;
+            Assert.IsNotNull(account);
+            AssertAccount1(account);
+
+            IList list = sqlMap.QueryForList("DynamicWithTwoDynamicElements", account);
+            AssertAccount1((Account)list[0]);
+        }
+
+        /// <summary>
+        /// Test Complex Dynamic
+        /// </summary>
+        [Test]
+        public void TestComplexDynamic()
+        {
+            Account account = new Account();
+            account.Id = 1;
+            account.FirstName = "Joe";
+            account.LastName = "Dalton";
+
+            IList list = sqlMap.QueryForList("ComplexDynamicStatement", account);
+
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(1, list.Count);
+        }
+
+        /// <summary>
+        /// Test GetAccounts Dynamic
+        /// </summary>
+        /// <remarks>
+        /// Bug Fix http://sourceforge.net/forum/message.php?msg_id=2646964
+        /// </remarks>
+        [Test]
+        public void TestGetAccountsDynamic()
+        {
+            Hashtable map = new Hashtable();
+            map.Add("MaximumAllowed", 100);
+
+            map.Add("FirstName", "Joe");
+            map.Add("LastName", "Dalton");
+            map.Add("EmailAddress", "Joe.Dalton@somewhere.com");
+
+            IList list = sqlMap.QueryForList("GetAccountsDynamic", map);
+
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(1, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsEqual with HashTable
+        /// </summary>
+        /// <remarks>
+        /// Bug Fix https://sourceforge.net/forum/message.php?msg_id=2840259
+        /// </remarks>
+        [Test]
+        public void TestDynamicSelectByIntLong()
+        {
+            Hashtable search = new Hashtable();
+            search.Add("year", 0);
+            search.Add("areaid", 0);
+
+            IList list = sqlMap.QueryForList("DynamicSelectByIntLong", search);
+
+            Assert.AreEqual(2, list.Count);
+            Assert.AreEqual(1, (list[0] as Other).Int);
+            Assert.AreEqual(8888888, (list[0] as Other).Long);
+            Assert.AreEqual(false, (list[0] as Other).Bool);
+
+            Assert.AreEqual(2, (list[1] as Other).Int);
+            Assert.AreEqual(9999999999, (list[1] as Other).Long);
+            Assert.AreEqual(true, (list[1] as Other).Bool);
+
+            //----------------------
+            search.Clear();
+            search.Add("year", 1);
+            search.Add("areaid", 0);
+
+            list = null;
+            list = sqlMap.QueryForList("DynamicSelectByIntLong", search);
+
+            Assert.AreEqual(1, list.Count);
+            //----------------------
+            search.Clear();
+            search.Add("year", 0);
+            search.Add("areaid", 9999999999);
+
+            list = null;
+            list = sqlMap.QueryForList("DynamicSelectByIntLong", search);
+
+            Assert.AreEqual(1, list.Count);
+            Assert.AreEqual(2, (list[0] as Other).Int);
+            //----------------------
+            search.Clear();
+            search.Add("year", 2);
+            search.Add("areaid", 9999999999);
+
+            list = null;
+            list = sqlMap.QueryForList("DynamicSelectByIntLong", search);
+
+            Assert.AreEqual(1, list.Count);
+            Assert.AreEqual(2, (list[0] as Other).Int);
+            Assert.AreEqual(9999999999, (list[0] as Other).Long);
+            Assert.AreEqual(true, (list[0] as Other).Bool);
+        }
+
+        /// <summary>
+        /// Test Dynamic With GUID
+        /// </summary>
+        [Test]
+        public void TestDynamicWithGUID()
+        {
+            Category category = new Category();
+            category.Name = "toto";
+            category.Guid = Guid.Empty;
+
+            int key = (int)sqlMap.Insert("InsertCategory", category);
+
+            category = new Category();
+            category.Name = "titi";
+            category.Guid = Guid.NewGuid();
+
+            Category categoryTest = (Category)sqlMap.QueryForObject("DynamicGuid", category);
+            Assert.IsNull(categoryTest);
+
+            category = new Category();
+            category.Name = "titi";
+            category.Guid = Guid.Empty;
+
+            categoryTest = (Category)sqlMap.QueryForObject("DynamicGuid", category);
+            Assert.IsNotNull(categoryTest);
+        }
+
+        /// <summary>
+        /// Test JIRA 11
+        /// </summary>
+        /// <remarks>
+        /// To test only for MSSQL with .NET SqlClient provider
+        /// </remarks>
+        [Test]
+        [Category("MSSQL")]
+        public void TestJIRA11()
+        {
+            Search search = new Search();
+            search.NumberSearch = 123;
+            search.StartDate = new DateTime(2004, 12, 25);
+            search.Operande = "like";
+            search.StartDateAnd = true;
+
+            CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
+            Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
+
+            IList list = sqlMap.QueryForList("Jira-IBATISNET-11", search);
+
+            Thread.CurrentThread.CurrentCulture = currentCulture;
+
+            Assert.AreEqual(0, list.Count);
+        }
+
+        /// <summary>
+        /// We've been using the stable version of Ibatis for a while and recently
+        /// upgraded to the latest alpha version 1.1.0.458. The old version was
+        /// able to handle mapping the .Net bool type to SqlServer's Bit column.
+        /// When we run sql maps that contain a bool property, we now get an
+        /// exception.
+        /// </summary>
+        /// <remarks>
+        /// No problems !!
+        /// </remarks>
+        [Test]
+        public void TestDynamicSelectByBool()
+        {
+            Other other = new Other();
+            other.Bool = true;
+
+            Other anOther = sqlMap.QueryForObject("DynamicSelectByBool", other) as Other;
+
+            Assert.IsNotNull(anOther);
+            Assert.AreEqual(2, anOther.Int);
+            Assert.AreEqual(9999999999, anOther.Long);
+            Assert.AreEqual(true, anOther.Bool);
+
+            other.Bool = false;
+            anOther = sqlMap.QueryForObject("DynamicSelectByBool", other) as Other;
+
+            Assert.IsNotNull(anOther);
+            Assert.AreEqual(1, anOther.Int);
+            Assert.AreEqual(8888888, anOther.Long);
+            Assert.AreEqual(false, anOther.Bool);
+
+        }
+
+        /// <summary>
+        /// Test JIRA 29
+        /// </summary>
+        [Test]
+        [Category("MSSQL")]
+        public void TestJIRA29()
+        {
+            Hashtable param = new Hashtable();
+            param["Foo"] = new DateTime(2003, 2, 17, 8, 15, 0);
+
+            Order order = sqlMap.QueryForObject("SelectOrderByDate", param) as Order;
+
+            Assert.IsNotNull(order);
+
+            Assert.AreEqual(11, order.Id);
+
+            CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
+            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
+
+            order = sqlMap.QueryForObject("SelectOrderByDateDynamic", param) as Order;
+
+            Thread.CurrentThread.CurrentCulture = currentCulture;
+
+            Assert.IsNotNull(order);
+
+            Assert.AreEqual(11, order.Id);
+        }
+
+        /// <summary>
+        /// Test JIRA 29
+        /// </summary>
+        [Test]
+        public void Test2ForJIRA29()
+        {
+            // init
+            Account account = new Account();
+
+            account.Id = 1234;
+            account.FirstName = "#The Pound Signs#";
+            account.LastName = "Gilles";
+            account.EmailAddress = "a.a@somewhere.com";
+
+            sqlMap.Insert("InsertAccountViaInlineParameters", account);
+
+            // test
+            Hashtable param = new Hashtable();
+            param["AccountName"] = "The Pound Signs";
+
+            Account testAccount = sqlMap.QueryForObject("SelectAccountJIRA29", param) as Account;
+
+            Assert.IsNotNull(testAccount);
+            Assert.AreEqual(1234, testAccount.Id);
+            Assert.AreEqual("#The Pound Signs#", testAccount.FirstName);
+        }
+
+        /// <summary>
+        /// Test JIRA 29
+        /// </summary>
+        [Test]
+        public void Test3ForJIRA29()
+        {
+            // init
+            Account account = new Account();
+
+            account.Id = 1234;
+            account.FirstName = "#The Pound Signs#";
+            account.LastName = "Gilles";
+            account.EmailAddress = "a.a@somewhere.com";
+
+            sqlMap.Insert("InsertAccountViaInlineParameters", account);
+
+            // test
+            Hashtable param = new Hashtable();
+            param["Foo"] = "The Pound Signs";
+
+            Account testAccount = sqlMap.QueryForObject("SelectAccountJIRA29-2", param) as Account;
+
+            Assert.IsNotNull(testAccount);
+            Assert.AreEqual(1234, testAccount.Id);
+            Assert.AreEqual("#The Pound Signs#", testAccount.FirstName);
+        }
+
+        [Test]
+        public void TestSelectKeyWithDynamicSql()
+        {
+            Account account = new Account();
+            account.Id = 99998;
+            account.FirstName = "R";
+            account.LastName = "G";
+
+            Hashtable param = new Hashtable(2);
+            param["Account"] = account;
+            param["AccountsTableName"] = "Accounts";
+            object selectKeyValue = sqlMap.Insert("SelectKeyWithDynamicSql", param);
+
+            Assert.IsNotNull(selectKeyValue);
+            Assert.AreEqual(99998, Convert.ToInt32(selectKeyValue));
+
+            Assert.IsTrue(param.ContainsKey("AccountId"));
+            Assert.AreEqual(99998, (int)param["AccountId"]);
+        }
+        #endregion
 
-	}
+    }
 }

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/DynamicTest.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/DynamicTest.cs?view=diff&rev=464983&r1=464982&r2=464983
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/DynamicTest.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/DynamicTest.cs Tue Oct 17 11:05:38 2006
@@ -9,448 +9,448 @@
 
 namespace IBatisNet.DataMapper.Test.NUnit.SqlMapTests
 {
-	/// <summary>
-	/// Summary description for DynamicTest.
-	/// </summary>
-	[TestFixture] 
-	public class DynamicTest : BaseTest
-	{
-		#region SetUp & TearDown
-
-		/// <summary>
-		/// SetUp
-		/// </summary>
-		[SetUp] 
-		public void Init() 
-		{
-			InitScript( sqlMap.DataSource, ScriptDirectory+"account-init.sql" );
-			InitScript( sqlMap.DataSource, ScriptDirectory+"account-procedure.sql", false );
-			InitScript( sqlMap.DataSource, ScriptDirectory+"order-init.sql" );
-			InitScript( sqlMap.DataSource, ScriptDirectory+"line-item-init.sql" );
-		}
-
-		/// <summary>
-		/// TearDown
-		/// </summary>
-		[TearDown] 
-		public void Dispose()
-		{ /* ... */ } 
-
-		#endregion
-
-		#region Dynamic tests
-
-		/// <summary>
-		/// Test Dynamic Sql On Column Selection
-		/// JIRA IBATISNET-114
-		/// </summary>
-		[Test]
-		public void TestDynamicSqlOnColumnSelection()
-		{
-			Account paramAccount = new Account();
-			Account resultAccount = new Account();
-			IList list = null;
-
-			paramAccount.LastName = "Dalton";
-			list = sqlMap.QueryForList("DynamicSqlOnColumnSelection", paramAccount);
-			resultAccount = (Account)list[0];
-			AssertAccount1( resultAccount );
-			Assert.AreEqual(5, list.Count);
-
-			paramAccount.LastName = "Bayon";
-			list = sqlMap.QueryForList("DynamicSqlOnColumnSelection", paramAccount);
-			resultAccount = (Account)list[0];
-			Assert.IsNull(resultAccount.FirstName);
-			Assert.IsNull(resultAccount.LastName);
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsNotEmpty True
-		/// </summary>
-		[Test] 
-		public void TestIsNotEmptyTrue() 
-		{
-			IList list = sqlMap.QueryForList("DynamicIsNotEmpty", "Joe");
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(1, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsNotEmpty False
-		/// </summary>
-		[Test] 
-		public void TestIsNotEmptyFalse() 
-		{
-			IList list = sqlMap.QueryForList("DynamicIsNotEmpty", "");
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsEqual true
-		/// </summary>
-		[Test] 
-		public void TestIsEqualTrue() 
-		{
-			IList list = sqlMap.QueryForList("DynamicIsEqual", "Joe");
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(1, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsEqual False
-		/// </summary>
-		[Test] 
-		public void TestIsEqualFalse()
-		{
-			IList list = sqlMap.QueryForList("DynamicIsEqual", "BLAH!");
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsGreater true
-		/// </summary>
-		[Test] 
-		public void TestIsGreaterTrue()
-		{
-			IList list = sqlMap.QueryForList("DynamicIsGreater", 5);
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(1, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsGreater false
-		/// </summary>
-		[Test]
-		public void TestIsGreaterFalse()
-		{
-			IList list = sqlMap.QueryForList("DynamicIsGreater", 1);
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsGreaterEqual true
-		/// </summary>
-		[Test]
-		public void TestIsGreaterEqualTrue()
-		{
-			IList list = sqlMap.QueryForList("DynamicIsGreaterEqual", 3);
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(1, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsGreaterEqual false
-		/// </summary>
-		[Test]
-		public void TestIsGreaterEqualFalse()
-		{
-			IList list = sqlMap.QueryForList("DynamicIsGreaterEqual", 1);
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsLess true
-		/// </summary>
-		[Test]
-		public void TestIsLessTrue() 
-		{
-			IList list = sqlMap.QueryForList("DynamicIsLess", 1);
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(1, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsLess false
-		/// </summary>
-		[Test]
-		public void TestIsLessFalse() 
-		{
-			IList list = sqlMap.QueryForList("DynamicIsLess", 5);
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsLessEqual true
-		/// </summary>
-		[Test]
-		public void TestIsLessEqualTrue() 
-		{
-			IList list = sqlMap.QueryForList("DynamicIsLessEqual", 3);
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(1, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsLessEqual false
-		/// </summary>
-		[Test]
-		public void TestIsLessEqualFalse() 
-		{
-			IList list = sqlMap.QueryForList("DynamicIsLessEqual", 5);
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsNotNull true
-		/// </summary>
-		[Test]
-		public void TestIsNotNullTrue() 
-		{
-			IList list = sqlMap.QueryForList("DynamicIsNotNull", "");
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(1, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsNotNull false
-		/// </summary>
-		[Test]
-		public void TestIsNotNullFalse()
-		{
-			IList list = sqlMap.QueryForList("DynamicIsNotNull", null);
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsPropertyAvailable true
-		/// </summary>
-		[Test]
-		public void TestIsPropertyAvailableTrue() 
-		{
-			Account account = new Account();
-			account.Id = 1;
-
-			IList list = sqlMap.QueryForList("DynamicIsPropertyAvailable", account);
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(1, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsPropertyAvailable false
-		/// </summary>
-		[Test]
-		public void TestIsPropertyAvailableFalse() 
-		{
-			string parameter = "1";
-
-			IList list = sqlMap.QueryForList("DynamicIsPropertyAvailable", parameter);
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsParameterPresent true
-		/// </summary>
-		[Test]
-		public void TestIsParameterPresentTrue() 
-		{
-			IList list = sqlMap.QueryForList("DynamicIsParameterPresent", 1);
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(1, list.Count);
-		}
-
-		/// <summary>
-		/// Test IsParameterPresent false
-		/// </summary>
-		[Test]
-		public void TestIsParameterPresentFalse() 
-		{
-			IList list = sqlMap.QueryForList("DynamicIsParameterPresent", null);
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test Iterate 
-		/// </summary>
-		[Test]
-		public void TestIterate() 
-		{
-			IList parameters = new ArrayList();
-			parameters.Add(1);
-			parameters.Add(2);
-			parameters.Add(3);
-
-			IList list = sqlMap.QueryForList("DynamicIterate", parameters);
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(3, list.Count);
-		}
-
-		/// <summary>
-		/// Test Iterate 2
-		/// </summary>
-		[Test]
-		public void TestIterate2() 
-		{
-			Account account = new Account();
-			account.Ids = new int[3] { 1, 2, 3};
-
-			IList list = sqlMap.QueryForList("DynamicIterate2", account);
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(3, list.Count);
-		}
-
-		/// <summary>
-		/// Test Empty Parameter Object
-		/// </summary>
-		[Test]
-		public void TestEmptyParameterObject() 
-		{
-			Account account = new Account();
-			account.Id = -1;
-			
-			IList list = sqlMap.QueryForList("DynamicQueryByExample", account);
-			
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test Dynamic With Extend
-		/// </summary>
-		[Test]
-		public void TestDynamicWithExtend() 
-		{
-			Account account = new Account();
-			account.Id = -1;
-			
-			IList list = sqlMap.QueryForList("DynamicWithExtend", account);
-			
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(5, list.Count);
-		}
-
-		/// <summary>
-		/// Test Multiple Iterate
-		/// </summary>
-		[Test]
-		public void TestMultiIterate() 
-		{
-			IList parameters = new ArrayList();
-			parameters.Add(1);
-			parameters.Add(2);
-			parameters.Add(3);
-			
-			IList list = sqlMap.QueryForList("MultiDynamicIterate", parameters);
-
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(3, list.Count);
-		}
-
-		/// <summary>
-		/// Test Array Property Iterate
-		/// </summary>
-		[Test]
-		public void TestArrayPropertyIterate() 
-		{
-			Account account = new Account();
-			account.Ids = new int[3] { 1, 2, 3};
-
-			IList list = sqlMap.QueryForList("DynamicQueryByExample", account);
-
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(3, list.Count);
-		}
-
-		/// <summary>
-		/// Test Complete Statement Substitution
-		/// </summary>
-		[Test]
-		[Ignore("No longer supported.")]
-		public void TestCompleteStatementSubst() 
-		{
-			string statement = "select" +
-			"    Account_ID			as Id," +
-			"    Account_FirstName	as FirstName," +
-			"    Account_LastName	as LastName," +
-			"    Account_Email		as EmailAddress" +
-			"  from Accounts" +
-			"  where Account_ID = #id#";
-			int id = 1;
-
-			Hashtable parameters = new Hashtable();
-			parameters.Add("id", id);
-			parameters.Add("statement", statement);
-
-			IList list = sqlMap.QueryForList("DynamicSubst", parameters);
-			AssertAccount1((Account) list[0]);
-			Assert.AreEqual(1, list.Count);
-		}
-
-		/// <summary>
-		/// Test Query By Example
-		/// </summary>
-		[Test]
-		public void TestQueryByExample() 
-		{
-			Account account;
-	
-			account = new Account();
-	
-			account.Id = 1;
-			account = sqlMap.QueryForObject("DynamicQueryByExample", account) as Account;
-			AssertAccount1(account);
-	
-			account = new Account();
-			account.FirstName = "Joe";
-			account = sqlMap.QueryForObject("DynamicQueryByExample", account) as Account;
-			AssertAccount1(account);
-	
-			account = new Account();
-			account.LastName = "Dalton";
-			account = sqlMap.QueryForObject("DynamicQueryByExample", account) as Account;
-			AssertAccount1(account);
-	
-			account = new Account();
-			account.EmailAddress = "Joe.Dalton@somewhere.com";
-			account = (Account) sqlMap.QueryForObject("DynamicQueryByExample", account) as Account;
-			AssertAccount1(account);
-	
-			account = new Account();
-			account.Id = 1;
-			account.FirstName = "Joe";
-			account.LastName = "Dalton";
-			account.EmailAddress = "Joe.Dalton@somewhere.com";
-			account = sqlMap.QueryForObject("DynamicQueryByExample", account) as Account;
-			AssertAccount1(account);
-		}
-
-		/// <summary>
-		/// Test Query By Example via private field
-		/// </summary>
-		[Test]
-		public void TestQueryByExampleViaField() 
-		{
-			Account account;
-	
-			account = new Account();
-	
-			account.Id = 1;
-			account = sqlMap.QueryForObject("DynamicQueryByExampleViaPrivateField", account) as Account;
-			AssertAccount1(account);
-	
-			account = new Account();
-			account.FirstName = "Joe";
-			account = sqlMap.QueryForObject("DynamicQueryByExampleViaPrivateField", account) as Account;
-			AssertAccount1(account);
-	
-			account = new Account();
-			account.LastName = "Dalton";
-			account = sqlMap.QueryForObject("DynamicQueryByExampleViaPrivateField", account) as Account;
-			AssertAccount1(account);
-	
-			account = new Account();
-			account.EmailAddress = "Joe.Dalton@somewhere.com";
-			account = (Account) sqlMap.QueryForObject("DynamicQueryByExampleViaPrivateField", account) as Account;
-			AssertAccount1(account);
-	
-			account = new Account();
-			account.Id = 1;
-			account.FirstName = "Joe";
-			account.LastName = "Dalton";
-			account.EmailAddress = "Joe.Dalton@somewhere.com";
-			account = sqlMap.QueryForObject("DynamicQueryByExampleViaPrivateField", account) as Account;
-			AssertAccount1(account);
-		}
-		#endregion
-	}
+    /// <summary>
+    /// Summary description for DynamicTest.
+    /// </summary>
+    [TestFixture]
+    public class DynamicTest : BaseTest
+    {
+        #region SetUp & TearDown
+
+        /// <summary>
+        /// SetUp
+        /// </summary>
+        [SetUp]
+        public void Init()
+        {
+            InitScript(sqlMap.DataSource, ScriptDirectory + "account-init.sql");
+            InitScript(sqlMap.DataSource, ScriptDirectory + "account-procedure.sql", false);
+            InitScript(sqlMap.DataSource, ScriptDirectory + "order-init.sql");
+            InitScript(sqlMap.DataSource, ScriptDirectory + "line-item-init.sql");
+        }
+
+        /// <summary>
+        /// TearDown
+        /// </summary>
+        [TearDown]
+        public void Dispose()
+        { /* ... */ }
+
+        #endregion
+
+        #region Dynamic tests
+
+        /// <summary>
+        /// Test Dynamic Sql On Column Selection
+        /// JIRA IBATISNET-114
+        /// </summary>
+        [Test]
+        public void TestDynamicSqlOnColumnSelection()
+        {
+            Account paramAccount = new Account();
+            Account resultAccount = new Account();
+            IList list = null;
+
+            paramAccount.LastName = "Dalton";
+            list = sqlMap.QueryForList("DynamicSqlOnColumnSelection", paramAccount);
+            resultAccount = (Account)list[0];
+            AssertAccount1(resultAccount);
+            Assert.AreEqual(5, list.Count);
+
+            paramAccount.LastName = "Bayon";
+            list = sqlMap.QueryForList("DynamicSqlOnColumnSelection", paramAccount);
+            resultAccount = (Account)list[0];
+            Assert.IsNull(resultAccount.FirstName);
+            Assert.IsNull(resultAccount.LastName);
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsNotEmpty True
+        /// </summary>
+        [Test]
+        public void TestIsNotEmptyTrue()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsNotEmpty", "Joe");
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(1, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsNotEmpty False
+        /// </summary>
+        [Test]
+        public void TestIsNotEmptyFalse()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsNotEmpty", "");
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsEqual true
+        /// </summary>
+        [Test]
+        public void TestIsEqualTrue()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsEqual", "Joe");
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(1, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsEqual False
+        /// </summary>
+        [Test]
+        public void TestIsEqualFalse()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsEqual", "BLAH!");
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsGreater true
+        /// </summary>
+        [Test]
+        public void TestIsGreaterTrue()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsGreater", 5);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(1, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsGreater false
+        /// </summary>
+        [Test]
+        public void TestIsGreaterFalse()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsGreater", 1);
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsGreaterEqual true
+        /// </summary>
+        [Test]
+        public void TestIsGreaterEqualTrue()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsGreaterEqual", 3);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(1, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsGreaterEqual false
+        /// </summary>
+        [Test]
+        public void TestIsGreaterEqualFalse()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsGreaterEqual", 1);
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsLess true
+        /// </summary>
+        [Test]
+        public void TestIsLessTrue()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsLess", 1);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(1, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsLess false
+        /// </summary>
+        [Test]
+        public void TestIsLessFalse()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsLess", 5);
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsLessEqual true
+        /// </summary>
+        [Test]
+        public void TestIsLessEqualTrue()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsLessEqual", 3);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(1, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsLessEqual false
+        /// </summary>
+        [Test]
+        public void TestIsLessEqualFalse()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsLessEqual", 5);
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsNotNull true
+        /// </summary>
+        [Test]
+        public void TestIsNotNullTrue()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsNotNull", "");
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(1, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsNotNull false
+        /// </summary>
+        [Test]
+        public void TestIsNotNullFalse()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsNotNull", null);
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsPropertyAvailable true
+        /// </summary>
+        [Test]
+        public void TestIsPropertyAvailableTrue()
+        {
+            Account account = new Account();
+            account.Id = 1;
+
+            IList list = sqlMap.QueryForList("DynamicIsPropertyAvailable", account);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(1, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsPropertyAvailable false
+        /// </summary>
+        [Test]
+        public void TestIsPropertyAvailableFalse()
+        {
+            string parameter = "1";
+
+            IList list = sqlMap.QueryForList("DynamicIsPropertyAvailable", parameter);
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsParameterPresent true
+        /// </summary>
+        [Test]
+        public void TestIsParameterPresentTrue()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsParameterPresent", 1);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(1, list.Count);
+        }
+
+        /// <summary>
+        /// Test IsParameterPresent false
+        /// </summary>
+        [Test]
+        public void TestIsParameterPresentFalse()
+        {
+            IList list = sqlMap.QueryForList("DynamicIsParameterPresent", null);
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test Iterate 
+        /// </summary>
+        [Test]
+        public void TestIterate()
+        {
+            IList parameters = new ArrayList();
+            parameters.Add(1);
+            parameters.Add(2);
+            parameters.Add(3);
+
+            IList list = sqlMap.QueryForList("DynamicIterate", parameters);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(3, list.Count);
+        }
+
+        /// <summary>
+        /// Test Iterate 2
+        /// </summary>
+        [Test]
+        public void TestIterate2()
+        {
+            Account account = new Account();
+            account.Ids = new int[3] { 1, 2, 3 };
+
+            IList list = sqlMap.QueryForList("DynamicIterate2", account);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(3, list.Count);
+        }
+
+        /// <summary>
+        /// Test Empty Parameter Object
+        /// </summary>
+        [Test]
+        public void TestEmptyParameterObject()
+        {
+            Account account = new Account();
+            account.Id = -1;
+
+            IList list = sqlMap.QueryForList("DynamicQueryByExample", account);
+
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test Dynamic With Extend
+        /// </summary>
+        [Test]
+        public void TestDynamicWithExtend()
+        {
+            Account account = new Account();
+            account.Id = -1;
+
+            IList list = sqlMap.QueryForList("DynamicWithExtend", account);
+
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(5, list.Count);
+        }
+
+        /// <summary>
+        /// Test Multiple Iterate
+        /// </summary>
+        [Test]
+        public void TestMultiIterate()
+        {
+            IList parameters = new ArrayList();
+            parameters.Add(1);
+            parameters.Add(2);
+            parameters.Add(3);
+
+            IList list = sqlMap.QueryForList("MultiDynamicIterate", parameters);
+
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(3, list.Count);
+        }
+
+        /// <summary>
+        /// Test Array Property Iterate
+        /// </summary>
+        [Test]
+        public void TestArrayPropertyIterate()
+        {
+            Account account = new Account();
+            account.Ids = new int[3] { 1, 2, 3 };
+
+            IList list = sqlMap.QueryForList("DynamicQueryByExample", account);
+
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(3, list.Count);
+        }
+
+        /// <summary>
+        /// Test Complete Statement Substitution
+        /// </summary>
+        [Test]
+        [Ignore("No longer supported.")]
+        public void TestCompleteStatementSubst()
+        {
+            string statement = "select" +
+            "    Account_ID			as Id," +
+            "    Account_FirstName	as FirstName," +
+            "    Account_LastName	as LastName," +
+            "    Account_Email		as EmailAddress" +
+            "  from Accounts" +
+            "  where Account_ID = #id#";
+            int id = 1;
+
+            Hashtable parameters = new Hashtable();
+            parameters.Add("id", id);
+            parameters.Add("statement", statement);
+
+            IList list = sqlMap.QueryForList("DynamicSubst", parameters);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(1, list.Count);
+        }
+
+        /// <summary>
+        /// Test Query By Example
+        /// </summary>
+        [Test]
+        public void TestQueryByExample()
+        {
+            Account account;
+
+            account = new Account();
+
+            account.Id = 5;
+            account = sqlMap.QueryForObject("DynamicQueryByExample", account) as Account;
+            AssertGilles(account);
+
+            account = new Account();
+            account.FirstName = "Gilles";
+            account = sqlMap.QueryForObject("DynamicQueryByExample", account) as Account;
+            AssertGilles(account);
+
+            account = new Account();
+            account.LastName = "Bayon";
+            account = sqlMap.QueryForObject("DynamicQueryByExample", account) as Account;
+            AssertGilles(account);
+
+            account = new Account();
+            account.EmailAddress = "gilles";
+            account = (Account)sqlMap.QueryForObject("DynamicQueryByExample", account) as Account;
+            AssertGilles(account);
+
+            account = new Account();
+            account.Id = 5;
+            account.FirstName = "Gilles";
+            account.LastName = "Bayon";
+            account.EmailAddress = "gilles.bayon@nospam.org";
+            account = sqlMap.QueryForObject("DynamicQueryByExample", account) as Account;
+            AssertGilles(account);
+        }
+
+        /// <summary>
+        /// Test Query By Example via private field
+        /// </summary>
+        [Test]
+        public void TestQueryByExampleViaField()
+        {
+            Account account;
+
+            account = new Account();
+
+            account.Id = 5;
+            account = sqlMap.QueryForObject("DynamicQueryByExampleViaPrivateField", account) as Account;
+            AssertGilles(account);
+
+            account = new Account();
+            account.FirstName = "Gilles";
+            account = sqlMap.QueryForObject("DynamicQueryByExampleViaPrivateField", account) as Account;
+            AssertGilles(account);
+
+            account = new Account();
+            account.LastName = "Bayon";
+            account = sqlMap.QueryForObject("DynamicQueryByExampleViaPrivateField", account) as Account;
+            AssertGilles(account);
+
+            account = new Account();
+            account.EmailAddress = "gilles";
+            account = (Account)sqlMap.QueryForObject("DynamicQueryByExampleViaPrivateField", account) as Account;
+            AssertGilles(account);
+
+            account = new Account();
+            account.Id = 5;
+            account.FirstName = "Gilles";
+            account.LastName = "Bayon";
+            account.EmailAddress = "gilles.bayon@nospam.org";
+            account = sqlMap.QueryForObject("DynamicQueryByExampleViaPrivateField", account) as Account;
+            AssertGilles(account);
+        }
+        #endregion
+    }
 }

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/StatementTest.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/StatementTest.cs?view=diff&rev=464983&r1=464982&r2=464983
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/StatementTest.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/StatementTest.cs Tue Oct 17 11:05:38 2006
@@ -223,16 +223,14 @@
         [Test]
         public void TestExecuteQueryForListWithResultMapWithDynamicElement()
         {
-            //IList list = sqlMap.QueryForList("GetAllAccountsViaResultMapWithDynamicElement", "LIKE");
             IList<Account> list = sqlMap.QueryForList<Account>("GetAllAccountsViaResultMapWithDynamicElement", "LIKE");
 
             AssertAccount1(list[0]);
-            Assert.AreEqual(3, list.Count);
+            Assert.AreEqual(4, list.Count);
             Assert.AreEqual(1, list[0].Id);
             Assert.AreEqual(2, list[1].Id);
             Assert.AreEqual(4, list[2].Id);
 
-            //list = sqlMap.QueryForList("GetAllAccountsViaResultMapWithDynamicElement", "=");
             list = sqlMap.QueryForList<Account>("GetAllAccountsViaResultMapWithDynamicElement", "=");
 
             Assert.AreEqual(0, list.Count);
@@ -455,7 +453,7 @@
             Assert.AreEqual("Averel.Dalton@somewhere.com", list[1]);
             Assert.IsNull(list[2]);
             Assert.AreEqual("Jack.Dalton@somewhere.com", list[3]);
-            Assert.IsNull(list[4]);
+            Assert.AreEqual("gilles.bayon@nospam.org", list[4]);
         }
 
         /// <summary>
@@ -470,7 +468,7 @@
             Assert.AreEqual("Averel.Dalton@somewhere.com", list[1]);
             Assert.IsNull(list[2]);
             Assert.AreEqual("Jack.Dalton@somewhere.com", list[3]);
-            Assert.IsNull(list[4]);
+            Assert.AreEqual("gilles.bayon@nospam.org", list[4]);
         }
 
         /// <summary>
@@ -497,12 +495,12 @@
 
             Assert.AreEqual(5, _index);
             Assert.AreEqual(5, list.Count);
-            AssertAccount1( list[0]);
-            Assert.AreEqual(1,  list[0].Id);
-            Assert.AreEqual(2,  list[1].Id);
-            Assert.AreEqual(3,  list[2].Id);
-            Assert.AreEqual(4,  list[3].Id);
-            Assert.AreEqual(5,  list[4].Id);
+            AssertAccount1(list[0]);
+            Assert.AreEqual(1, list[0].Id);
+            Assert.AreEqual(2, list[1].Id);
+            Assert.AreEqual(3, list[2].Id);
+            Assert.AreEqual(4, list[3].Id);
+            Assert.AreEqual(5, list[4].Id);
 
         }
 
@@ -514,7 +512,7 @@
         {
             IList<Order> list = sqlMap.QueryForList<Order>("GetManyOrderWithConstructor", null);
 
-            Assert.IsTrue(list.Count>0);
+            Assert.IsTrue(list.Count > 0);
         }
 
         #endregion



Mime
View raw message