|
From: <ste...@us...> - 2010-05-01 18:38:27
|
Revision: 4977
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4977&view=rev
Author: steverstrong
Date: 2010-05-01 18:38:21 +0000 (Sat, 01 May 2010)
Log Message:
-----------
Fix for JIRA NH-2169
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Linq/Functions/StringGenerator.cs
trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
Added Paths:
-----------
trunk/nhibernate/src/NHibernate.Test/Linq/CasingTest.cs
Modified: trunk/nhibernate/src/NHibernate/Linq/Functions/StringGenerator.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Linq/Functions/StringGenerator.cs 2010-04-29 21:49:12 UTC (rev 4976)
+++ trunk/nhibernate/src/NHibernate/Linq/Functions/StringGenerator.cs 2010-05-01 18:38:21 UTC (rev 4977)
@@ -122,11 +122,11 @@
if (((method.Name == "ToUpper") || (method.Name == "ToUpperInvariant")))
{
- methodName = "lower";
+ methodName = "upper";
}
else
{
- methodName = "upper";
+ methodName = "lower";
}
return treeBuilder.MethodCall(methodName, visitor.Visit(targetObject).AsExpression());
Added: trunk/nhibernate/src/NHibernate.Test/Linq/CasingTest.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/Linq/CasingTest.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/Linq/CasingTest.cs 2010-05-01 18:38:21 UTC (rev 4977)
@@ -0,0 +1,49 @@
+using System.Linq;
+using NUnit.Framework;
+
+namespace NHibernate.Test.Linq
+{
+ [TestFixture]
+ public class CasingTest : LinqTestCase
+ {
+ [Test]
+ public void ToUpper()
+ {
+ var name = (from e in db.Employees
+ where e.EmployeeId == 1
+ select e.FirstName.ToUpper())
+ .Single();
+ Assert.AreEqual("NANCY", name);
+ }
+
+ [Test]
+ public void ToUpperInvariant()
+ {
+ var name = (from e in db.Employees
+ where e.EmployeeId == 1
+ select e.FirstName.ToUpper())
+ .Single();
+ Assert.AreEqual("NANCY", name);
+ }
+
+ [Test]
+ public void ToLower()
+ {
+ var name = (from e in db.Employees
+ where e.EmployeeId == 1
+ select e.FirstName.ToLower())
+ .Single();
+ Assert.AreEqual("nancy", name);
+ }
+
+ [Test]
+ public void ToLowerInvariant()
+ {
+ var name = (from e in db.Employees
+ where e.EmployeeId == 1
+ select e.FirstName.ToLowerInvariant())
+ .Single();
+ Assert.AreEqual("nancy", name);
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-04-29 21:49:12 UTC (rev 4976)
+++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-05-01 18:38:21 UTC (rev 4977)
@@ -381,6 +381,7 @@
<Compile Include="Linq\AggregateTests.cs" />
<Compile Include="Linq\BinaryBooleanExpressionTests.cs" />
<Compile Include="Linq\BinaryExpressionOrdererTests.cs" />
+ <Compile Include="Linq\CasingTest.cs" />
<Compile Include="Linq\CollectionAssert.cs" />
<Compile Include="Linq\DateTimeTests.cs" />
<Compile Include="Linq\DynamicQueryTests.cs" />
@@ -2131,9 +2132,9 @@
<EmbeddedResource Include="CfgTest\Loquacious\EntityToCache.hbm.xml" />
<EmbeddedResource Include="DriverTest\SqlServerCeEntity.hbm.xml" />
<Content Include="DynamicEntity\package.html" />
- <EmbeddedResource Include="ListIndex\SimpleOneToMany.hbm.xml" />
- <EmbeddedResource Include="NHSpecificTest\SessionIdLoggingContextTest\Mappings.hbm.xml" />
- <EmbeddedResource Include="NHSpecificTest\NH2113\Mappings.hbm.xml" />
+ <EmbeddedResource Include="ListIndex\SimpleOneToMany.hbm.xml" />
+ <EmbeddedResource Include="NHSpecificTest\SessionIdLoggingContextTest\Mappings.hbm.xml" />
+ <EmbeddedResource Include="NHSpecificTest\NH2113\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH1981\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH2074\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH2077\Mappings.hbm.xml" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|