From: <fab...@us...> - 2009-04-22 22:56:26
|
Revision: 4201 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4201&view=rev Author: fabiomaulo Date: 2009-04-22 22:56:16 +0000 (Wed, 22 Apr 2009) Log Message: ----------- Minor Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs trunk/nhibernate/src/NHibernate.Test/QueryTest/NamedParametersFixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs 2009-04-22 22:12:41 UTC (rev 4200) +++ trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs 2009-04-22 22:56:16 UTC (rev 4201) @@ -661,7 +661,7 @@ hql = "select cast(7+123.3-1*a.BodyWeight as int) from Animal a group by cast(7+123.3-1*a.BodyWeight as int) having cast(7+123.3-1*a.BodyWeight as int)>0"; l = s.CreateQuery(hql).List(); Assert.AreEqual(1, l.Count); - Assert.AreEqual(129, l[0]); + Assert.AreEqual((int)(7 + 123.3 - 1 * 1.3d), l[0]); // Rendered in HAVING using a property and named param (NOT SUPPORTED) try Modified: trunk/nhibernate/src/NHibernate.Test/QueryTest/NamedParametersFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/QueryTest/NamedParametersFixture.cs 2009-04-22 22:12:41 UTC (rev 4200) +++ trunk/nhibernate/src/NHibernate.Test/QueryTest/NamedParametersFixture.cs 2009-04-22 22:56:16 UTC (rev 4201) @@ -1,6 +1,7 @@ using System; using System.Collections; using NUnit.Framework; +using NHibernate.Hql.Ast.ANTLR; namespace NHibernate.Test.QueryTest { @@ -41,16 +42,22 @@ /// Verifying that a <see langword="null" /> value passed into SetParameter(name, val) throws /// an exception /// </summary> - [Test, ExpectedException(typeof(ArgumentNullException))] + [Test] public void TestNullNamedParameter() { + if (sessions.Settings.QueryTranslatorFactory is ASTQueryTranslatorFactory) + { + Assert.Ignore("Not supported; The AST parser can guess the type."); + } ISession s = OpenSession(); try { - IQuery q = s.CreateQuery("from Simple as s where s.Name=:Name"); - q.SetParameter("Name", null); + IQuery q = s.CreateQuery("from Simple as s where s.Name=:pName"); + q.SetParameter("pName", null); + Assert.Fail("should throw if can't guess the type of parameter"); } + catch (ArgumentNullException) {} finally { s.Close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |