File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed
src/FluentNHibernate.Testing/AutoMapping Expand file tree Collapse file tree 1 file changed +55
-0
lines changed 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
+ using FluentNHibernate . Testing . Automapping ;
6
+ using NUnit . Framework ;
7
+
8
+ namespace FluentNHibernate . Testing . AutoMapping
9
+ {
10
+ [ TestFixture ]
11
+ public class InheritanceTests : BaseAutoMapFixture
12
+ {
13
+ [ Test ]
14
+ public void AutoMapSimpleProperties ( )
15
+ {
16
+ Model < ThirdLevel > ( ) ;
17
+
18
+ Test < ThirdLevel > ( mapping =>
19
+ {
20
+ mapping . Element ( "//id" ) . HasAttribute ( "name" , "Id" ) ;
21
+ mapping . Element ( "//property[@name='Rate']/column" ) . HasAttribute ( "name" , "Rate" ) ;
22
+ mapping . Element ( "//property[@name='SecondRate']/column" ) . HasAttribute ( "name" , "SecondRate" ) ;
23
+ } ) ;
24
+ }
25
+ }
26
+
27
+ public abstract class Base1
28
+ {
29
+ public virtual int Id { get ; protected set ; }
30
+ public abstract void Foo ( int x ) ;
31
+ }
32
+
33
+ public class Derived1 : Base1
34
+ {
35
+ public virtual Decimal Rate { get ; set ; }
36
+ public override void Foo ( int x )
37
+ {
38
+ }
39
+
40
+ public string GetSomething ( )
41
+ {
42
+ return Environment . NewLine ;
43
+ }
44
+ }
45
+
46
+ public class SecondLevel : Derived1
47
+ {
48
+ public virtual Double SecondRate { get ; set ; }
49
+ }
50
+
51
+ public class ThirdLevel : SecondLevel
52
+ {
53
+ public virtual Boolean Flag { get ; set ; }
54
+ }
55
+ }
You can’t perform that action at this time.
0 commit comments