public void AfterSetMultiColumnsCantSetSimpleColumn() { var mapping = new HbmMapKey(); var mapper = new MapKeyMapper(mapping); mapper.Columns(cm => cm.Length(50), cm => cm.SqlType("VARCHAR(10)")); mapper.Executing(m => m.Column(cm => cm.Length(50))).Throws<ConfOrm.MappingException>(); }
public void AfterSetMultiColumnsCantSetSimpleColumn() { var mapping = new HbmMapKey(); var mapper = new MapKeyMapper(mapping); mapper.Columns(cm => cm.Length(50), cm => cm.SqlType("VARCHAR(10)")); mapper.Executing(m => m.Column(cm => cm.Length(50))).Throws <MappingException>(); }
public void WhenSetMultiColumnsValuesThenAutoassignColumnNames() { var mapping = new HbmMapKey(); var mapper = new MapKeyMapper(mapping); mapper.Columns(cm => cm.Length(50), cm => cm.SqlType("VARCHAR(10)")); mapping.Columns.Should().Have.Count.EqualTo(2); mapping.Columns.All(cm => cm.name.Satisfy(n => !string.IsNullOrEmpty(n))); }
public void WhenSetMultiColumnsValuesThenAddColumns() { var mapping = new HbmMapKey(); var mapper = new MapKeyMapper(mapping); mapper.Type <MyType>(); mapper.Columns(cm => { cm.Name("column1"); cm.Length(50); }, cm => { cm.Name("column2"); cm.SqlType("VARCHAR(10)"); }); mapping.Columns.Should().Have.Count.EqualTo(2); }
public void WhenSetMultiColumnsValuesThenAddColumns() { var mapping = new HbmMapKey(); var mapper = new MapKeyMapper(mapping); mapper.Type<MyType>(); mapper.Columns(cm => { cm.Name("column1"); cm.Length(50); }, cm => { cm.Name("column2"); cm.SqlType("VARCHAR(10)"); }); mapping.Columns.Should().Have.Count.EqualTo(2); }