File tree Expand file tree Collapse file tree 3 files changed +38
-3
lines changed
src/NHibernate.Test/NHSpecificTest/NH2783 Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Original file line number Diff line number Diff line change
1
+ using System . Collections ;
1
2
using System . Collections . Generic ;
2
3
3
4
namespace NHibernate . Test . NHSpecificTest . NH2783
@@ -8,6 +9,6 @@ class Bar
8
9
9
10
public virtual int DynValString2 { get ; set ; }
10
11
11
- public virtual IDictionary < string , object > MyProps { get ; set ; } = new Dictionary < string , object > ( ) ;
12
+ public virtual IDictionary MyProps { get ; set ; } = new Dictionary < string , object > ( ) ;
12
13
}
13
14
}
Original file line number Diff line number Diff line change @@ -5,8 +5,32 @@ namespace NHibernate.Test.NHSpecificTest.NH2783
5
5
[ TestFixture ]
6
6
public class Fixture : BugTestCase
7
7
{
8
+ private object _fooId ;
9
+ private object _barId ;
10
+
8
11
protected override void OnSetUp ( )
9
12
{
13
+ using ( var session = OpenSession ( ) )
14
+ using ( var transaction = session . BeginTransaction ( ) )
15
+ {
16
+ var bar = new Bar
17
+ {
18
+ MyProps =
19
+ {
20
+ [ "DynValString2" ] = "a"
21
+ }
22
+ } ;
23
+ _barId = session . Save ( bar ) ;
24
+ _fooId = session . Save (
25
+ new Foo
26
+ {
27
+ MyProps =
28
+ {
29
+ [ "DynPointer" ] = bar
30
+ }
31
+ } ) ;
32
+ transaction . Commit ( ) ;
33
+ }
10
34
}
11
35
12
36
protected override void OnTearDown ( )
@@ -26,8 +50,17 @@ protected override void OnTearDown()
26
50
}
27
51
28
52
[ Test ]
29
- public void DoNothing ( )
53
+ public void CanReadDynPointerFromFoo ( )
30
54
{
55
+ using ( var session = OpenSession ( ) )
56
+ using ( session . BeginTransaction ( ) )
57
+ {
58
+ var foo = session . Get < Foo > ( _fooId ) ;
59
+ var bar = foo . MyProps [ "DynPointer" ] ;
60
+ Assert . That ( bar , Is . Not . Null ) ;
61
+ Assert . That ( bar , Is . InstanceOf < Bar > ( ) ) ;
62
+ Assert . That ( bar , Has . Property ( "Id" ) . EqualTo ( _barId ) ) ;
63
+ }
31
64
}
32
65
}
33
66
}
Original file line number Diff line number Diff line change
1
+ using System . Collections ;
1
2
using System . Collections . Generic ;
2
3
3
4
namespace NHibernate . Test . NHSpecificTest . NH2783
@@ -6,6 +7,6 @@ class Foo
6
7
{
7
8
public virtual int Id { get ; set ; }
8
9
9
- public virtual IDictionary < string , object > MyProps { get ; set ; } = new Dictionary < string , object > ( ) ;
10
+ public virtual IDictionary MyProps { get ; set ; } = new Dictionary < string , object > ( ) ;
10
11
}
11
12
}
You can’t perform that action at this time.
0 commit comments