From: <fab...@us...> - 2011-03-08 19:27:36
|
Revision: 5444 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5444&view=rev Author: fabiomaulo Date: 2011-03-08 19:27:30 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Fix NH-2480 Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/Linq/LinqTestCase.cs Modified: trunk/nhibernate/src/NHibernate.Test/Linq/LinqTestCase.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/LinqTestCase.cs 2011-03-07 06:03:44 UTC (rev 5443) +++ trunk/nhibernate/src/NHibernate.Test/Linq/LinqTestCase.cs 2011-03-08 19:27:30 UTC (rev 5444) @@ -1,8 +1,10 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; +using SharpTestsEx; namespace NHibernate.Test.Linq { @@ -63,15 +65,9 @@ } } - public void AssertByIds<T, K>(IEnumerable<T> q, K[] ids, Converter<T, K> getId) + public void AssertByIds<TEntity, TId>(IEnumerable<TEntity> entities, TId[] expectedIds, Converter<TEntity, TId> entityIdGetter) { - int current = 0; - foreach (T customer in q) - { - Assert.AreEqual(ids[current], getId(customer)); - current += 1; - } - Assert.AreEqual(current, ids.Length); + entities.Select(x => entityIdGetter(x)).Should().Have.SameValuesAs(expectedIds); } } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |