Skip to content

Commit 3c01e61

Browse files
committed
Make the testcase a bit more interested and avoid fix warnings.
1 parent 3a00a30 commit 3c01e61

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed
Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.IO;
4-
using System.Linq;
5-
using System.Reflection;
6-
using System.Text;
1+
using System.Linq;
72
using NHibernate.Linq;
83
using NUnit.Framework;
94

@@ -16,7 +11,7 @@ protected override void OnSetUp()
1611
using (var session = OpenSession())
1712
using (var tx = session.BeginTransaction())
1813
{
19-
var child = new Entity { Id = 1, Flag = false };
14+
var child = new Entity { Id = 1, Flag = true };
2015
var parent = new Entity { Id = 2, ChildInterface = child, ChildConcrete = child };
2116

2217
session.Save(child);
@@ -41,24 +36,28 @@ private static void DeleteAll<T>(ISession session)
4136
session.CreateQuery("delete from " + typeof(T).Name).ExecuteUpdate();
4237
}
4338

44-
[Test]
45-
public void TrueOrChildPropertyConcrete()
46-
{
47-
using (var session = OpenSession())
48-
{
49-
var result = session.Query<IEntity>().Where(x => true || x.ChildConcrete.Flag).ToList();
50-
Assert.That(result, Has.Count.EqualTo(2));
51-
}
52-
}
39+
[Test]
40+
public void TrueOrChildPropertyConcrete()
41+
{
42+
using (var session = OpenSession())
43+
{
44+
var result = session.Query<IEntity>()
45+
.Where(x => x.ChildConcrete == null || x.ChildConcrete.Flag)
46+
.ToList();
47+
Assert.That(result, Has.Count.EqualTo(2));
48+
}
49+
}
5350

54-
[Test]
55-
public void TrueOrChildPropertyInterface()
56-
{
57-
using (var session = OpenSession())
58-
{
59-
var result = session.Query<IEntity>().Where(x => true || ((Entity)x.ChildInterface).Flag).ToList();
60-
Assert.That(result, Has.Count.EqualTo(2));
61-
}
62-
}
51+
[Test]
52+
public void TrueOrChildPropertyInterface()
53+
{
54+
using (var session = OpenSession())
55+
{
56+
var result = session.Query<IEntity>()
57+
.Where(x => x.ChildInterface == null || ((Entity) x.ChildInterface).Flag)
58+
.ToList();
59+
Assert.That(result, Has.Count.EqualTo(2));
60+
}
61+
}
6362
}
6463
}

0 commit comments

Comments
 (0)