Revision: 4797
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4797&view=rev
Author: steverstrong
Date: 2009-10-22 20:30:27 +0000 (Thu, 22 Oct 2009)
Log Message:
-----------
Added another Linq test
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate.Test/Linq/LinqQuerySamples.cs
Modified: trunk/nhibernate/src/NHibernate.Test/Linq/LinqQuerySamples.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/Linq/LinqQuerySamples.cs 2009-10-22 20:27:17 UTC (rev 4796)
+++ trunk/nhibernate/src/NHibernate.Test/Linq/LinqQuerySamples.cs 2009-10-22 20:30:27 UTC (rev 4797)
@@ -45,6 +45,43 @@
}, x => x.CustomerId);
}
+ [Category("WHERE")]
+ [Test(Description = "This sample uses WHERE to filter for Customers in London and then Madrid to ensure that the parameterization is working.")]
+ public void DLinq1b()
+ {
+ string city = "London";
+
+ IOrderedQueryable<Customer> q =
+ from c in db.Customers
+ where c.Address.City == city
+ orderby c.CustomerId
+ select c;
+
+ AssertByIds(q, new[]
+ {
+ "AROUT",
+ "BSBEV",
+ "CONSH",
+ "EASTC",
+ "NORTS",
+ "SEVES"
+ }, x => x.CustomerId);
+
+ city = "Madrid";
+
+ q = from c in db.Customers
+ where c.Address.City == city
+ orderby c.CustomerId
+ select c;
+
+ AssertByIds(q, new[]
+ {
+ "BOLID",
+ "FISSA",
+ "ROMEY"
+ }, x => x.CustomerId);
+ }
+
[Category("SELECT/DISTINCT")]
[Test(
Description =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|