Skip to content

Commit 748847a

Browse files
committed
Test for mapping nested generic classes
1 parent cb53d04 commit 748847a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/FluentNHibernate.Testing/DomainModel/Mapping/PropertyPartTester.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,18 @@ public void CanSpecifyNotUpdate()
441441
.Element("class/property").HasAttribute("update", "false");
442442
}
443443

444+
[Test]
445+
public void MapNestedGeneric()
446+
{
447+
new MappingTester<OuterTarget<String>.NestedTarget>()
448+
.ForMapping(m =>
449+
{
450+
m.Id(x => x.Id);
451+
m.Map(x => x.Value);
452+
})
453+
.Element("class").HasAttribute("table", "`NestedTarget_String`");
454+
}
455+
444456
#region Custom IUserType impl for testing
445457
public class CustomTypeForTesting : IUserType
446458
{
@@ -609,6 +621,15 @@ public class ComponentTarget
609621
public object Name { get; set; }
610622
}
611623

624+
class OuterTarget<T>
625+
{
626+
public class NestedTarget
627+
{
628+
public virtual int Id { get; set; }
629+
public virtual T Value { get; set; }
630+
}
631+
}
632+
612633
public class FakePropertyAccessor : IPropertyAccessor
613634
{
614635
public IGetter GetGetter(Type theClass, string propertyName)

0 commit comments

Comments
 (0)