From: <fab...@us...> - 2011-05-03 21:34:02
|
Revision: 5797 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5797&view=rev Author: fabiomaulo Date: 2011-05-03 21:33:56 +0000 (Tue, 03 May 2011) Log Message: ----------- Tests for unsupported feature for Skip and Take using parameters instead values Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/LimitClauseFixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/LimitClauseFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/LimitClauseFixture.cs 2011-05-03 11:20:54 UTC (rev 5796) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/LimitClauseFixture.cs 2011-05-03 21:33:56 UTC (rev 5797) @@ -68,6 +68,20 @@ s.Close(); } + [Test, Ignore("Not supported yet.")] + public void SkipWithParameter() + { + ISession s = OpenSession(); + ITransaction txn = s.BeginTransaction(); + + var actual = s.CreateQuery("from Human h order by h.bodyWeight skip :jump").SetInt32("jump", 2).List<Human>().Select(h => h.BodyWeight).ToArray(); + var expected = new[] { 10, 15, 20 }; + CollectionAssert.AreEqual(expected, actual); + + txn.Commit(); + s.Close(); + } + [Test] public void Take() { @@ -82,6 +96,20 @@ s.Close(); } + [Test, Ignore("Not supported yet.")] + public void TakeWithParameter() + { + ISession s = OpenSession(); + ITransaction txn = s.BeginTransaction(); + + var actual = s.CreateQuery("from Human h order by h.bodyWeight take :jump").SetInt32("jump", 2).List<Human>().Select(h => h.BodyWeight).ToArray(); + var expected = new[] { 5, 6 }; + CollectionAssert.AreEqual(expected, actual); + + txn.Commit(); + s.Close(); + } + [Test] public void SkipTake() { @@ -96,6 +124,22 @@ s.Close(); } + [Test, Ignore("Not supported yet.")] + public void SkipTakeWithParameter() + { + ISession s = OpenSession(); + ITransaction txn = s.BeginTransaction(); + + var actual = s.CreateQuery("from Human h order by h.bodyWeight skip :pSkip take :pTake") + .SetInt32("pSkip", 1) + .SetInt32("pTake", 3).List<Human>().Select(h => h.BodyWeight).ToArray(); + var expected = new[] { 6, 10, 15 }; + CollectionAssert.AreEqual(expected, actual); + + txn.Commit(); + s.Close(); + } + [Test] public void TakeSkip() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |