Skip to content

Commit 56198a9

Browse files
committed
FunctionTests: TrimTrailingWhitespace() should be "initial" to match actual assert.
Also tweak it slightly to make it independent of RDBMS engine behaviour with regards to trailing white space in string comparisons.
1 parent 806c41d commit 56198a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/NHibernate.Test/Linq/FunctionTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,16 +266,16 @@ public void Trim()
266266
}
267267

268268
[Test]
269-
public void TrimTrailingWhitespace()
269+
public void TrimInitialWhitespace()
270270
{
271271
using (session.BeginTransaction())
272272
{
273-
session.Save(new AnotherEntity {Input = " hi "});
273+
session.Save(new AnotherEntity {Input = " hi"});
274274
session.Save(new AnotherEntity {Input = "hi"});
275275
session.Save(new AnotherEntity {Input = "heh"});
276276
session.Flush();
277277

278-
Assert.AreEqual(TestDialect.IgnoresTrailingWhitespace ? 2 : 1, session.Query<AnotherEntity>().Where(e => e.Input.TrimStart() == "hi ").Count());
278+
Assert.That(session.Query<AnotherEntity>().Count(e => e.Input.TrimStart() == "hi"), Is.EqualTo(2));
279279

280280
// Let it rollback to get rid of temporary changes.
281281
}

0 commit comments

Comments
 (0)