File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
FluentNHibernate/MappingModel Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 464
464
<Compile Include =" MappingModel\Identity\CompositeIdMappingTester.cs" />
465
465
<Compile Include =" MappingModel\Output\XmlNaturalIdWriterTester.cs" />
466
466
<Compile Include =" MappingModel\SortingTests.cs" />
467
+ <Compile Include =" Utils\TypeReferenceEnumTests.cs" />
467
468
</ItemGroup >
468
469
<ItemGroup >
469
470
<Content Include =" ..\..\tools\NHibernate\NHibernate.ByteCode.Castle.dll" >
Original file line number Diff line number Diff line change
1
+ using FluentNHibernate . MappingModel ;
2
+ using NUnit . Framework ;
3
+ using FluentNHibernate . Mapping ;
4
+
5
+ namespace FluentNHibernate . Testing . Utils
6
+ {
7
+ [ TestFixture ]
8
+ public class TypeReferenceEnumTests
9
+ {
10
+ [ Test ]
11
+ public void IsEnumOnTypeReferenceToGenericEnumMapperShouldBeTrue ( )
12
+ {
13
+ var enumTypeReference = new TypeReference ( typeof ( GenericEnumMapper < TestEnum > ) ) ;
14
+ enumTypeReference . IsEnum . ShouldBeTrue ( ) ;
15
+ }
16
+
17
+ private enum TestEnum
18
+ {
19
+ Value1
20
+ }
21
+
22
+
23
+ }
24
+ }
Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ public bool IsEnum
35
35
if ( innerType == null )
36
36
return false ;
37
37
38
+ if ( innerType . IsGenericType
39
+ && innerType . GetGenericTypeDefinition ( ) == typeof ( FluentNHibernate . Mapping . GenericEnumMapper < > ) )
40
+ {
41
+ return true ;
42
+ }
43
+
44
+
38
45
return innerType . IsEnum ;
39
46
}
40
47
}
You can’t perform that action at this time.
0 commit comments