File tree Expand file tree Collapse file tree 4 files changed +82
-0
lines changed Expand file tree Collapse file tree 4 files changed +82
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections ;
3
+ using System . Collections . Generic ;
4
+ using System . Linq ;
5
+ using System . Text ;
6
+ using NUnit . Framework ;
7
+ using NHibernate . Linq ;
8
+
9
+ namespace NHibernate . Test . NHSpecificTest . NH3252
10
+ {
11
+ [ TestFixture ]
12
+ public class Fixture : TestCase
13
+ {
14
+ protected override string MappingsAssembly
15
+ {
16
+ get { return "NHibernate.Test" ; }
17
+ }
18
+
19
+ protected override IList Mappings
20
+ {
21
+ get { return new string [ ] { "NHSpecificTest.NH3252.Mappings.hbm.xml" } ; }
22
+ }
23
+
24
+ [ Test ]
25
+ public void VerifyThatWeCanSaveAndLoad ( )
26
+ {
27
+ using ( ISession session = OpenSession ( ) )
28
+ using ( ITransaction transaction = session . BeginTransaction ( ) )
29
+ {
30
+
31
+ session . Save ( new Note { Text = new String ( '0' , 9000 ) } ) ;
32
+ transaction . Commit ( ) ;
33
+ }
34
+
35
+ using ( ISession session = OpenSession ( ) )
36
+ using ( ITransaction transaction = session . BeginTransaction ( ) )
37
+ {
38
+
39
+ var note = session . Query < Note > ( ) . First ( ) ;
40
+ Assert . AreEqual ( 9000 , note . Text . Length ) ;
41
+ }
42
+ }
43
+
44
+ protected override void OnTearDown ( )
45
+ {
46
+ using ( ISession session = OpenSession ( ) )
47
+ using ( ITransaction transaction = session . BeginTransaction ( ) )
48
+ {
49
+ session . Delete ( "from System.Object" ) ;
50
+
51
+ session . Flush ( ) ;
52
+ transaction . Commit ( ) ;
53
+ }
54
+ }
55
+ }
56
+ }
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" namespace =" NHibernate.Test.NHSpecificTest.NH3252" assembly =" NHibernate.Test" >
3
+ <class name =" Note" >
4
+ <id name =" Id" type =" Int32" >
5
+ <generator class =" identity" />
6
+ </id >
7
+ <property name =" Text" type =" AnsiString" length =" 10000" />
8
+ </class >
9
+ </hibernate-mapping >
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+ using System . Text ;
5
+
6
+ namespace NHibernate . Test . NHSpecificTest . NH3252
7
+ {
8
+ class Note
9
+ {
10
+ public virtual int Id { get ; protected set ; }
11
+
12
+ public virtual string Text { get ; set ; }
13
+ }
14
+ }
Original file line number Diff line number Diff line change 801
801
<Compile Include =" NHSpecificTest\NH3428\Fixture.cs" />
802
802
<Compile Include =" NHSpecificTest\NH3316\ByCodeFixture.cs" />
803
803
<Compile Include =" NHSpecificTest\NH3316\Entity.cs" />
804
+ <Compile Include =" NHSpecificTest\NH3252\Fixture.cs" />
805
+ <Compile Include =" NHSpecificTest\NH3252\Note.cs" />
804
806
<Compile Include =" NHSpecificTest\NH3408\Fixture.cs" />
805
807
<Compile Include =" NHSpecificTest\NH3408\Model.cs" />
806
808
<Compile Include =" NHSpecificTest\NH2297\CustomCompositeUserType.cs" />
3163
3165
<EmbeddedResource Include =" NHSpecificTest\NH3505\Mappings.hbm.xml" />
3164
3166
<EmbeddedResource Include =" NHSpecificTest\NH3428\Mappings.hbm.xml" />
3165
3167
<EmbeddedResource Include =" NHSpecificTest\NH3641\Mappings.hbm.xml" />
3168
+ <EmbeddedResource Include =" NHSpecificTest\NH3252\Mappings.hbm.xml" />
3166
3169
<EmbeddedResource Include =" NHSpecificTest\NH3408\Mappings.hbm.xml" />
3167
3170
<EmbeddedResource Include =" NHSpecificTest\NH2408\Mappings.hbm.xml" />
3168
3171
<EmbeddedResource Include =" NHSpecificTest\NH2297\MappingsNames.hbm.xml" />
You can’t perform that action at this time.
0 commit comments