File tree Expand file tree Collapse file tree 4 files changed +77
-0
lines changed
Expand file tree Collapse file tree 4 files changed +77
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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" />
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" />
You can’t perform that action at this time.
0 commit comments