Skip to content

Commit bbb2245

Browse files
committed
Added unit test
1 parent 339eae3 commit bbb2245

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/NHibernate.Test/MappingByCode/ExplicitMappingTests/BasicMappingOfSimpleClass.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using System;
2+
using System.Collections;
3+
using System.Collections.Generic;
24
using System.Linq;
35
using NHibernate.Cfg.MappingSchema;
46
using NHibernate.Mapping.ByCode;
@@ -32,6 +34,24 @@ public void MapClassWithIdAndProperty()
3234
ModelIsWellFormed(hbmMapping);
3335
}
3436

37+
[Test]
38+
public void MapClassWithIdAndPropertyWithParamsDictionary()
39+
{
40+
var mapper = new ModelMapper();
41+
mapper.Class<MyClass>(ca =>
42+
{
43+
ca.Id(x => x.Id, map =>
44+
{
45+
map.Column("MyClassId");
46+
//NH-3415
47+
map.Generator(Generators.HighLow, gmap => gmap.Params(new Dictionary<string, object> { { "max_low", 100 } }));
48+
});
49+
ca.Property(x => x.Something, map => map.Length(150));
50+
});
51+
var hbmMapping = mapper.CompileMappingFor(new[] { typeof(MyClass) });
52+
ModelIsWellFormed(hbmMapping);
53+
}
54+
3555
[Test]
3656
public void WhenMapClassWithoutIdThenApplyTypeOfGeneratorDef()
3757
{

0 commit comments

Comments
 (0)