Skip to content

Commit b6e5136

Browse files
committed
Add ignored embryo for NH-3401 test case.
1 parent 5bf22f0 commit b6e5136

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
3+
namespace NHibernate.Test.NHSpecificTest.NH3401
4+
{
5+
class Entity
6+
{
7+
public virtual int Id { get; set; }
8+
public virtual string Name { get; set; }
9+
public virtual bool YesNo { get; set; }
10+
}
11+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using System.Linq;
2+
using NHibernate.Linq;
3+
using NUnit.Framework;
4+
5+
namespace NHibernate.Test.NHSpecificTest.NH3401
6+
{
7+
[TestFixture]
8+
public class Fixture : BugTestCase
9+
{
10+
protected override void OnTearDown()
11+
{
12+
using (ISession session = OpenSession())
13+
using (ITransaction transaction = session.BeginTransaction())
14+
{
15+
session.Delete("from System.Object");
16+
17+
session.Flush();
18+
transaction.Commit();
19+
}
20+
}
21+
22+
[Test(Description = "NH-3401")]
23+
[Ignore("Test not implemented - this can be used a base for a proper test case for NH-3401.")]
24+
public void YesNoParameterLengthShouldBe1()
25+
{
26+
// MISSING PART: Asserts for the SQL parameter sizes in the generated commands.
27+
28+
using (ISession session = OpenSession())
29+
using (ITransaction transaction = session.BeginTransaction())
30+
{
31+
var e1 = new Entity {Name = "Bob"};
32+
session.Save(e1);
33+
34+
var e2 = new Entity {Name = "Sally", YesNo = true};
35+
session.Save(e2);
36+
37+
session.Flush();
38+
transaction.Commit();
39+
}
40+
41+
42+
using (ISession session = OpenSession())
43+
using (session.BeginTransaction())
44+
{
45+
var result = from e in session.Query<Entity>()
46+
where e.YesNo
47+
select e;
48+
49+
Assert.AreEqual(1, result.ToList().Count);
50+
}
51+
}
52+
}
53+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" namespace="NHibernate.Test.NHSpecificTest.NH3401">
3+
4+
<class name="Entity">
5+
<id name="Id" generator="native" />
6+
<property name="Name" />
7+
<property name="YesNo" type="YesNo" />
8+
</class>
9+
10+
</hibernate-mapping>

src/NHibernate.Test/NHibernate.Test.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,8 @@
670670
<Compile Include="NHSpecificTest\BagWithLazyExtraAndFilter\Domain.cs" />
671671
<Compile Include="NHSpecificTest\BagWithLazyExtraAndFilter\Fixture.cs" />
672672
<Compile Include="Component\Basic\ComponentWithUniqueConstraintTests.cs" />
673+
<Compile Include="NHSpecificTest\NH3401\Entity.cs" />
674+
<Compile Include="NHSpecificTest\NH3401\Fixture.cs" />
673675
<Compile Include="NHSpecificTest\NH1863\Domain.cs" />
674676
<Compile Include="NHSpecificTest\NH1863\Fixture.cs" />
675677
<Compile Include="MappingByCode\ExpliticMappingTests\ClassWithoutNamespaceTests.cs" />
@@ -2916,6 +2918,7 @@
29162918
<EmbeddedResource Include="NHSpecificTest\NH1291AnonExample\Mappings.hbm.xml" />
29172919
</ItemGroup>
29182920
<ItemGroup>
2921+
<EmbeddedResource Include="NHSpecificTest\NH3401\Mappings.hbm.xml" />
29192922
<EmbeddedResource Include="NHSpecificTest\NH2049\Mappings.hbm.xml" />
29202923
<EmbeddedResource Include="NHSpecificTest\NH1863\Mappings.hbm.xml" />
29212924
<EmbeddedResource Include="NHSpecificTest\NH3614\Mappings.hbm.xml" />

0 commit comments

Comments
 (0)